fix(container): stop copying / and instead only copy zitadel (#691)

* chore: stop copying / and instead only copy zitadel

* Update Dockerfile

* Update release.yml

* enable anchors debug

* fix(container): don't copy alpine content into scratch execpt pwd

* chore: remove need step

* merge master
This commit is contained in:
Florian Forster 2020-10-02 09:38:49 +02:00 committed by GitHub
parent 198370325d
commit 103d786ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 29 deletions

View File

@ -47,4 +47,4 @@ jobs:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: site/__sapper__/export
CLEAN: true
CLEAN: true

View File

@ -126,30 +126,6 @@ jobs:
repository: ${{ github.repository }}
tag_with_ref: true
tag_with_sha: true
container-vulnerability-scan:
runs-on: ubuntu-18.04
needs: container-prod
steps:
- name: Source checkout
uses: actions/checkout@v2
- name: Generate Short SHA Container Tag
id: vars
run: echo "::set-output name=sha_short::SHA-$(git rev-parse --short HEAD)"
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Docker Login
run: docker login $REGISTRY -u $GITHUB_ACTOR -p $GITHUB_TOKEN
- uses: anchore/scan-action@master
with:
image-reference: "${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.vars.outputs.sha_short }}"
dockerfile-path: "./build/docker/Dockerfile"
fail-build: false
acs-report-enable: true
- name: Upload Anchore Scan Report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
release:
runs-on: ubuntu-18.04

View File

@ -1,14 +1,14 @@
# This Stage prepares the user in the container and copies the files
FROM alpine:latest as prepare
RUN adduser -D zitadel
COPY .artifacts/zitadel-linux-amd64 /zitadel
COPY cmd/zitadel/*.yaml /
RUN chmod a+x /zitadel
COPY .artifacts/zitadel-linux-amd64 /app/zitadel
COPY cmd/zitadel/*.yaml /app/
RUN chmod a+x /app/zitadel
# This Stage is intended as production image
FROM scratch as final
COPY --from=prepare /etc/passwd /etc/passwd
COPY --from=prepare / /
COPY --from=prepare /app /
USER zitadel
HEALTHCHECK NONE
ENTRYPOINT ["/zitadel"]