You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
857 B

  1. # Default to Go 1.13
  2. ARG GO_VERSION=1.13
  3. FROM docker.io/library/golang:${GO_VERSION}-alpine as build
  4. # Necessary to run 'go get' and to compile the linked binary
  5. RUN apk add git musl-dev
  6. ADD . /go/src/github.com/dutchcoders/transfer.sh
  7. WORKDIR /go/src/github.com/dutchcoders/transfer.sh
  8. ENV GO111MODULE=on
  9. # build & install server
  10. ARG GOOS=linux
  11. ARG GOARCH=amd64
  12. RUN go get ./... && CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags -a -tags netgo -ldflags '-w -extldflags "-static"' -o /go/bin/transfersh github.com/dutchcoders/transfer.sh
  13. FROM scratch AS final
  14. LABEL maintainer="Andrea Spacca <andrea.spacca@gmail.com>"
  15. COPY --from=build /go/bin/transfersh /go/bin/transfersh
  16. COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
  17. ENTRYPOINT ["/go/bin/transfersh", "--listener", ":8080"]
  18. EXPOSE 8080