Skip to content

Commit

Permalink
Switching to entrypoint script. Changing root symlink to retain binar…
Browse files Browse the repository at this point in the history
…y name

Signed-off-by: Samuel Attwood <sam@synadia.com>
  • Loading branch information
samuelattwood committed Feb 2, 2023
1 parent c560fba commit d0c300f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 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 base

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}" "$@"
5 changes: 3 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ target "goreleaser" {

target "nats-surveyor" {
contexts = {
base = image_base
build = "target:goreleaser"
base = image_base
build = "target:goreleaser"
assets = "cicd/assets"
}
args = {
GO_APP = "nats-surveyor"
Expand Down

0 comments on commit d0c300f

Please sign in to comment.