Advertisement
amihub

Docker ctor

Jul 20th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. FROM golang:alpine as builder
  2. # prepare go env
  3. ENV GOPATH /go
  4. ENV NAME cloud-torrent
  5. ENV PACKAGE github.com/jpillora/$NAME
  6. ENV PACKAGE_DIR $GOPATH/src/$PACKAGE
  7. ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
  8. ENV CGO_ENABLED 0
  9. ENV AUTH 'admin:admin'
  10.  
  11. RUN apk upgrade --update && apk add --no-cache ca-certificates bash gcc musl-dev openssl git go curl
  12. RUN git clone https://$PACKAGE.git $PACKAGE_DIR
  13. RUN cd $PACKAGE_DIR && go build -ldflags "-X main.VERSION=$(git describe --abbrev=0 --tags)" -o /usr/local/bin/$NAME
  14.  
  15. FROM alpine:latest
  16. RUN apk upgrade --update && apk add --no-cache ca-certificates openssl curl
  17. COPY --from=builder /usr/local/bin/$NAME /
  18. WORKDIR downloads
  19. RUN ls -a
  20. ENTRYPOINT ["/bin/sh", "-c","cloud-torrent","--auth","$AUTH"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement