From 955dec8694dcadb110671f96f3824d9a48fb465e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 17 Nov 2020 20:55:41 +0100 Subject: [PATCH] fix: config path (#978) * fix: config path * change cache * use alpine * workaround the lifecycle hook problem --- .github/workflows/codecov.yml | 1 - build/docker-compose-debug.yml | 4 ++-- build/docker-compose-dev.yml | 4 ++-- build/dockerfile | 18 ++++++++++-------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index d1cebdcb4d..e969fc7362 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -31,7 +31,6 @@ jobs: tags: ${{ env.REGISTRY }}/${{ github.repository }}:coverage push: false cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,dest=/tmp/.buildx-cache target: go-codecov outputs: type=local,dest=. - uses: codecov/codecov-action@v1 diff --git a/build/docker-compose-debug.yml b/build/docker-compose-debug.yml index 8447bd1b83..e212cf4deb 100644 --- a/build/docker-compose-debug.yml +++ b/build/docker-compose-debug.yml @@ -4,7 +4,7 @@ services: angular: build: context: .. - dockerfile: build/Dockerfile + dockerfile: build/dockerfile target: dev-angular-build args: ENV: dev @@ -14,7 +14,7 @@ services: go: build: context: .. - dockerfile: build/Dockerfile + dockerfile: build/dockerfile target: dev-go-build args: ENV: dev diff --git a/build/docker-compose-dev.yml b/build/docker-compose-dev.yml index 9dc4d46642..da0ec42061 100644 --- a/build/docker-compose-dev.yml +++ b/build/docker-compose-dev.yml @@ -4,7 +4,7 @@ services: angular: build: context: .. - dockerfile: build/Dockerfile + dockerfile: build/dockerfile target: dev-angular-build args: ENV: dev @@ -14,7 +14,7 @@ services: go: build: context: .. - dockerfile: build/Dockerfile + dockerfile: build/dockerfile target: dev-go-build args: ENV: dev diff --git a/build/dockerfile b/build/dockerfile index 6e341895ef..ffa4ad35b9 100644 --- a/build/dockerfile +++ b/build/dockerfile @@ -112,16 +112,18 @@ RUN go get github.com/go-delve/delve/cmd/dlv ####################### ## Final Production Image ####################### -FROM ${ENV}-go-build as artifact -RUN useradd zitadel -COPY cmd/zitadel/*.yaml app/ -RUN chmod a+x zitadel-linux-amd64 -RUN mv zitadel-linux-amd64 app/zitadel +FROM alpine:latest as artifact +RUN adduser -D zitadel +COPY cmd/zitadel/*.yaml / +COPY --from=prod-go-build /go/src/github.com/caos/zitadel/zitadel-linux-amd64 /zitadel +RUN chmod a+x zitadel +RUN ls -la / ## Scratch Image -FROM scratch as final +FROM scratch as final COPY --from=artifact /etc/passwd /etc/passwd -COPY --from=artifact /go/src/github.com/caos/zitadel/app app/ +## TODO copy should be removed once the operator branch is merged +COPY --from=artifact / / USER zitadel HEALTHCHECK NONE -ENTRYPOINT ["/app/zitadel"] \ No newline at end of file +ENTRYPOINT ["/zitadel"] \ No newline at end of file