diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index a3aab7a..0000000 --- a/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file -# Ignore build and test binaries. -bin/ diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml index cda768d..3829ba4 100644 --- a/.github/workflows/releases.yaml +++ b/.github/workflows/releases.yaml @@ -33,3 +33,21 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GHR_PATH: bin/manager + + - name: Login to Github Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile.release + push: true + tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/$(echo ${{ github.repository }} | cut -d'/' -f2):${{ github.ref_name }} \ No newline at end of file diff --git a/Dockerfile.release b/Dockerfile.release new file mode 100644 index 0000000..6b7fabf --- /dev/null +++ b/Dockerfile.release @@ -0,0 +1,13 @@ +# Use distroless as minimal base image to package the manager binary +# Refer to https://github.com/GoogleContainerTools/distroless for more details +FROM gcr.io/distroless/static:nonroot + +WORKDIR / + +COPY bin/manager / + +EXPOSE 8080 + +USER 65532:65532 + +ENTRYPOINT ["/manager"] \ No newline at end of file