Skip to content

Commit

Permalink
Merge pull request #1 from depot/feat/registry
Browse files Browse the repository at this point in the history
feat(registry): add OCI registry proxy over stdin/stdout
  • Loading branch information
goller authored Apr 28, 2023
2 parents 862cf55 + 9434737 commit bab1b4f
Show file tree
Hide file tree
Showing 4 changed files with 524 additions and 2 deletions.
28 changes: 26 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
FROM alpine:3
FROM golang:1.20 AS go-builder

RUN apk add --no-cache socat
WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY *.go ./

RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -x -v -o /srv

FROM alpine:3 AS socat-builder

RUN apk --update add build-base bash automake git curl linux-headers

WORKDIR /src
RUN curl -LO http://www.dest-unreach.org/socat/download/socat-1.7.4.4.tar.gz && \
tar xzvf socat-1.7.4.4.tar.gz && \
cd socat-1.7.4.4 && \
CC='/usr/bin/gcc -static' CFLAGS='-fPIC' ./configure --disable-help --disable-stdio --disable-fdnum --disable-file --disable-creat --disable-gopen --disable-pipe --disable-termios --disable-unix --disable-abstract-unixsocket --disable-rawip --disable-genericsocket --disable-udp --disable-sctp --disable-vsock --disable-socks4 --disable-socks4a --disable-proxy --disable-system --disable-pty --disable-fs --disable-readline --disable-openssl --disable-tun --disable-sycls --disable-filan --disable-libwrap && \
make && \
strip socat

FROM scratch AS release-stage
COPY --from=go-builder /srv /srv
COPY --from=socat-builder /src/socat-1.7.4.4/socat /usr/bin/socat
CMD ["/srv/helper"]
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/depot/helper

go 1.20
Empty file added go.sum
Empty file.
Loading

0 comments on commit bab1b4f

Please sign in to comment.