Skip to content

Commit

Permalink
(feat) Multistage Docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
splattner committed Sep 27, 2023
1 parent 84de7e8 commit 46eab30
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21
FROM golang:1.21 AS build-env

WORKDIR /go/src/app
COPY ./ .
Expand All @@ -8,4 +8,24 @@ RUN ls -al
RUN go get -d -v ./...
RUN go install -v ./...

ENTRYPOINT [ "/go/bin/ucrt" ]

FROM alpine:3

LABEL maintainer "Sebastian Plattner"
LABEL org.opencontainers.image.title "Unfolded Cirrle Remote Two Integraton Driber"
LABEL org.opencontainers.image.description "Golang based integration driver for a Unfolded Circle Remote Two"
LABEL org.opencontainers.image.authors "Sebastian Plattner"
LABEL org.opencontainers.image.source https://github.com/splattner/goucrt
LABEL org.opencontainers.image.licenses MPL-2.0

RUN apk --no-cache add libc6-compat

COPY --from=build-env /go/bin/ucrt /app/

WORKDIR /app

RUN adduser -D nonroot
USER nonroot

ENTRYPOINT [ "/app/ucrt" ]
CMD [ "help" ]

0 comments on commit 46eab30

Please sign in to comment.