Skip to content

Commit

Permalink
change back end base image to alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Apr 22, 2020
1 parent 46bf2b5 commit 9cb1a38
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
FROM golang:1.13 as build
FROM golang:1.13-alpine as build
ARG RELEASE=TRUE
WORKDIR /var/myrunes
ADD . .

RUN apk add git
RUN go mod download
RUN go build \
-v -o /app/myrunes -ldflags "\
-X github.com/myrunes/backend/internal/static.Release=${RELEASE} \
-X github.com/myrunes/backend/internal/static.AppVersion=$(git describe --tags --abbrev=0)+$(git describe --tags | sed -n 's/^[0-9]\+\.[0-9]\+\.[0-9]\+-\([0-9]\+\)-.*$/\1/p')" \
./cmd/server/*.go

FROM debian:stretch-slim AS final
# ----------------------------------------------------------

FROM alpine:latest AS final
LABEL maintainer="zekro <contact@zekro.de>"
RUN apt-get update &&\
apt-get install -y ca-certificates &&\
update-ca-certificates
WORKDIR /app

RUN apk add ca-certificates
COPY --from=build /app .

EXPOSE 8080
Expand Down

0 comments on commit 9cb1a38

Please sign in to comment.