mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
Dockerfile: wrap athens with tini (#1190)
This commit is contained in:
@@ -12,6 +12,11 @@ ARG VERSION="unset"
|
||||
|
||||
RUN DATE="$(date -u +%Y-%m-%d-%H:%M:%S-%Z)" && GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -ldflags "-X github.com/gomods/athens/pkg/build.version=$VERSION -X github.com/gomods/athens/pkg/build.buildDate=$DATE" -o /bin/athens-proxy ./cmd/proxy
|
||||
|
||||
# Add tini, see https://github.com/gomods/athens/issues/1155 for details.
|
||||
ENV TINI_VERSION v0.18.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
|
||||
RUN chmod +x /tini
|
||||
|
||||
FROM alpine
|
||||
|
||||
ENV GO111MODULE=on
|
||||
@@ -19,6 +24,7 @@ ENV GO111MODULE=on
|
||||
COPY --from=builder /bin/athens-proxy /bin/athens-proxy
|
||||
COPY --from=builder /go/src/github.com/gomods/athens/config.dev.toml /config/config.toml
|
||||
COPY --from=builder /usr/local/go/bin/go /bin/go
|
||||
COPY --from=builder /tini /bin/tini
|
||||
|
||||
RUN apk add --update bzr git mercurial openssh-client subversion procps fossil && \
|
||||
mkdir -p /usr/local/go
|
||||
@@ -27,4 +33,6 @@ ENV GO_ENV=production
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT [ "tini", "--" ]
|
||||
|
||||
CMD ["athens-proxy", "-config_file=/config/config.toml"]
|
||||
|
||||
Reference in New Issue
Block a user