1
0
mirror of https://github.com/ericchiang/pup synced 2025-03-22 01:15:42 +00:00
pup/Dockerfile
Tobias Gesellchen 30287da158 Add Dockerfile
2020-02-03 21:51:58 +01:00

25 lines
490 B
Docker

FROM alpine:3.10 AS builder
LABEL builder=true
ENV CGO_ENABLED=0
ENV GOPATH /go
RUN apk add --update -t build-deps go git mercurial libc-dev gcc libgcc
RUN go get github.com/ericchiang/pup \
&& cd $GOPATH/src/github.com/ericchiang/pup \
&& go build \
-a \
-ldflags '-s -w -extldflags "-static"' \
-o /bin/pup
RUN adduser -DH user
FROM scratch
ENTRYPOINT [ "/pup" ]
CMD [ "--help" ]
COPY --from=builder /etc/passwd /etc/passwd
USER user
COPY --from=builder /bin/pup /pup