Skip to content

Commit

Permalink
feat(containerImage): add Containerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Icikowski committed Nov 14, 2022
1 parent ca7319a commit eb1a4bf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions dist/container/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM golang:latest AS builder
ARG version
ARG gitCommit
ARG buildTime
ENV BUILD_VERSION=${version:-unknown}
ENV BUILD_GIT_COMMIT=${gitCommit:-unknown}
ENV BUILD_TIME=${buildTime:-unknown}
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download -x
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o goosymock -ldflags "-X 'github.com/Icikowski/GoosyMock/meta.Version=${BUILD_VERSION}' -X 'github.com/Icikowski/GoosyMock/meta.GitCommit=${BUILD_GIT_COMMIT}' -X 'github.com/Icikowski/GoosyMock/meta.BuildTime=${BUILD_TIME}' -X 'github.com/Icikowski/GoosyMock/meta.BinaryType=static' -w -extldflags '-static'" .

FROM gcr.io/distroless/static:nonroot
LABEL maintainer "Piotr Icikowski <[email protected]>"
LABEL org.opencontainers.image.title "GoosyMock - "
LABEL org.opencontainers.image.description "Simple & easy to configure test service for serving content through HTTP"
LABEL org.opencontainers.image.authors "Piotr Icikowski"
LABEL org.opencontainers.image.vendor "Piotr Icikowski"
LABEL org.opencontainers.image.url "https://github.com/Icikowski/GoosyMock"
LABEL org.opencontainers.image.source "https://github.com/Icikowski/GoosyMock"
LABEL org.opencontainers.image.licenses "GPL-3.0-or-later"
WORKDIR /
COPY --from=builder /app/goosymock .
USER 65532:65532
ENTRYPOINT ["/goosymock"]

0 comments on commit eb1a4bf

Please sign in to comment.