Skip to content

Commit

Permalink
revert Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
onedr0p authored May 4, 2020
1 parent c083e94 commit d37366d
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
#
# Stage 1
#
FROM golang:1.14-alpine as build

ENV GO111MODULE=on \
CGO_ENABLED=0

WORKDIR /build

COPY . .
RUN apk --no-cache add ca-certificates tini \

RUN apk --no-cache add ca-certificates \
&& export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) \
&& export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \
&& GOARM=$(echo ${TARGETPLATFORM} | cut -d / -f3) \
&& export GOARM=${GOARM:1} \
&& GOARM=$(echo ${TARGETPLATFORM} | cut -d / -f3); export GOARM=${GOARM:1} \
&& go mod download \
&& go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o exportarr /build/cmd/exportarr/. \
&& chmod +x exportarr
#
# Stage 2
#

FROM gcr.io/distroless/static:nonroot
ENV PORT="9707"

COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /sbin/tini /sbin/tini
USER nonroot:nonroot
COPY --from=build /build/exportarr /usr/local/bin/exportarr
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/exportarr"]

USER nonroot:nonroot
ENTRYPOINT ["exportarr"]

0 comments on commit d37366d

Please sign in to comment.