Skip to content

Commit

Permalink
Update Dockerfile. (#154)
Browse files Browse the repository at this point in the history
Use multistage build to reduce size and attack surface.

Signed-off-by: Adrian Mouat <[email protected]>
  • Loading branch information
amouat authored Aug 4, 2023
1 parent a69ffbf commit e30d191
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM cgr.dev/chainguard/go:1.20
FROM cgr.dev/chainguard/go:1.20@sha256:a50b9f354ad5a645e15b2bf97ac1153e650e7a0eec46cb014875019db1081a4d as build

WORKDIR /opt/gh-jira-issue-sync
COPY . .
RUN CGO_ENABLED=0 go build .

RUN apk update --no-cache && apk add ca-certificates
FROM cgr.dev/chainguard/static

COPY bin/gh-jira-issue-sync /opt/gh-jira-issue-sync/gh-jira-issue-sync
COPY --from=build gh-jira-issue-sync /bin/gh-jira-issue-sync

COPY config.json /opt/gh-jira-issue-sync/config.json
COPY config.json /etc/config.json

ENTRYPOINT ["./gh-jira-issue-sync"]
ENTRYPOINT ["/bin/gh-jira-issue-sync"]

CMD ["--config", "config.json"]
CMD ["--config", "/etc/config.json"]

0 comments on commit e30d191

Please sign in to comment.