This repository has been archived on 2022-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
morty/Dockerfile
Renovate Bot 7666cdc16a
All checks were successful
continuous-integration/woodpecker the build was successful
Update golang:1.17.3-alpine3.13 Docker digest to 07674a9
2021-11-09 05:00:51 +00:00

28 lines
922 B
Docker

# STEP 1 build executable binary
FROM golang:1.17.3-alpine3.13@sha256:07674a997a6ece514c1397c44b1d6cc45b9ade6ba9acb1d3c6072537c4cf82f1 AS builder
ENV MORTY_VERSION="f5bff1e285d3f973cacf73318e55175edafd633f"
WORKDIR $GOPATH/src/github.com/asciimoo/morty
RUN apk upgrade --no-cache && \
apk add --no-cache git && \
git clone https://github.com/asciimoo/morty.git . && \
git checkout "${MORTY_VERSION}"
RUN go get -d -v && gofmt -l ./ && go build .
# STEP 2 build the image including only the binary
FROM alpine:3.14.2@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412c2fa221cf1a824e6a
RUN apk upgrade --no-cache && \
apk --no-cache add ca-certificates && \
rm -f /var/cache/apk/* && \
adduser -D -h /usr/local/morty -s /bin/false morty morty
COPY --from=builder /go/src/github.com/asciimoo/morty/morty /usr/local/morty/morty
EXPOSE 3000
USER morty
ENTRYPOINT ["/usr/local/morty/morty"]