diff --git a/cicd/Dockerfile b/cicd/Dockerfile index 3b3b1d6..11cf4c7 100644 --- a/cicd/Dockerfile +++ b/cicd/Dockerfile @@ -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"] diff --git a/cicd/assets/entrypoint.sh b/cicd/assets/entrypoint.sh new file mode 100644 index 0000000..323c250 --- /dev/null +++ b/cicd/assets/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec "/${GO_APP}" "$@" diff --git a/docker-bake.hcl b/docker-bake.hcl index b843845..5ca18ac 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -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"