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.

26 lines
780 B

  1. # Default to Go 1.13
  2. ARG GO_VERSION=1.13
  3. FROM 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. RUN go get -u ./... && CGO_ENABLED=0 go build -ldflags -a -tags netgo -ldflags '-w -extldflags "-static"' -o /go/bin/transfersh github.com/dutchcoders/transfer.sh
  11. FROM scratch AS final
  12. LABEL maintainer="Andrea Spacca <andrea.spacca@gmail.com>"
  13. COPY --from=build /go/bin/transfersh /go/bin/transfersh
  14. COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
  15. ENTRYPOINT ["/go/bin/transfersh", "--listener", ":8080"]
  16. EXPOSE 8080