Skip to content

Commit

Permalink
Merge pull request #224 from nats-io/entrypoint-update
Browse files Browse the repository at this point in the history
Updating entrypoint
  • Loading branch information
samuelattwood authored Apr 24, 2023
2 parents 0caf592 + b8dce73 commit 18e9b7e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cicd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ EOT
FROM alpine:3.17.3

ARG GO_APP
ENV GO_APP ${GO_APP}

COPY --from=deps --chmod=755 /go/bin/${GO_APP} /usr/local/bin/${GO_APP}

COPY --from=deps /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

RUN ln -s /usr/local/bin/${GO_APP} /entrypoint
COPY --from=assets entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint"]
RUN ln -s /usr/local/bin/${GO_APP} /${GO_APP} && chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
2 changes: 2 additions & 0 deletions cicd/assets/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec "/${GO_APP}" "$@"
1 change: 1 addition & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ target "goreleaser" {
target "prometheus-nats-exporter" {
contexts = {
build = "target:goreleaser"
assets = "cicd/assets"
}
args = {
GO_APP = "prometheus-nats-exporter"
Expand Down

0 comments on commit 18e9b7e

Please sign in to comment.