Skip to content

Commit

Permalink
Update build to use latest go version and create alpine based image
Browse files Browse the repository at this point in the history
  • Loading branch information
hamburghammer committed Mar 28, 2021
1 parent 83c202f commit 2e58b05
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
FROM golang:1.15.6
FROM docker.io/golang:1.16 AS build
WORKDIR /app/gohttpserver
ADD . /app/gohttpserver
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-X main.VERSION=docker' -o gohttpserver

FROM debian:stretch
WORKDIR /app
FROM docker.io/alpine:latest
RUN mkdir -p /app/public
RUN apt-get update && apt-get install -y ca-certificates
VOLUME /app/public
WORKDIR /app
ADD assets ./assets
COPY --from=0 /app/gohttpserver/gohttpserver .
COPY --from=build /app/gohttpserver/gohttpserver .
EXPOSE 8000
ENTRYPOINT [ "/app/gohttpserver", "--root=/app/public" ]
CMD []

0 comments on commit 2e58b05

Please sign in to comment.