0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-16 21:56:43 -05:00

docker: update to go1.12 and build imageproxy as a module

This commit is contained in:
Will Norris 2019-03-22 07:31:42 +00:00
parent b7975bcbe8
commit 5a07762971
2 changed files with 13 additions and 10 deletions

View file

@ -7,6 +7,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- updated docker image to use go1.12 compiler and build imageproxy as a go module.
## [0.8.0] (2019-03-21)
### Added

View file

@ -1,27 +1,27 @@
FROM golang:1.9 as build
FROM golang:1.12 as build
MAINTAINER Will Norris <will@willnorris.com>
RUN useradd -u 1001 go
WORKDIR /go/src/willnorris.com/go/imageproxy
ADD . .
WORKDIR /app
WORKDIR /go/src/willnorris.com/go/imageproxy/cmd/imageproxy
RUN go-wrapper download
RUN CGO_ENABLED=0 GOOS=linux go-wrapper install
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -v ./cmd/imageproxy
FROM scratch
WORKDIR /go/bin
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /go/bin/imageproxy .
COPY --from=build /app/imageproxy /app/imageproxy
USER go
CMD ["-addr", "0.0.0.0:8080"]
ENTRYPOINT ["/go/bin/imageproxy"]
ENTRYPOINT ["/app/imageproxy"]
EXPOSE 8080