Skip to content

Commit 37f7e1d

Browse files
committed
Fix(deps): Update docker/setup-qemu-action commit SHA (#5)
fix(ci): Resolve Docker build workflow failures and update dependencies This commit addresses multiple issues that caused the Docker `build-scan-push` workflow to fail, ensuring the pipeline is robust and functional. Key fixes: * **Action Dependencies:** Updates several GitHub Actions to valid, stable commit SHAs to resolve "action not found" errors: * `docker/setup-qemu-action` * `docker/setup-buildx-action` * `docker/build-push-action` * `aquasecurity/trivy-action` * **Image Tagging:** Adds a step to convert the `GITHUB_REPOSITORY` name to lowercase, fixing the "repository name must be lowercase" error during the build. * **Dockerfile:** * Ensures the `/install` directory is created in the builder stage, preventing `COPY` failures when no production dependencies exist. * Removes a redundant `poetry install` command.
1 parent 43090d8 commit 37f7e1d

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

.github/workflows/docker.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,28 @@ jobs:
2929
password: ${{ secrets.GITHUB_TOKEN }}
3030

3131
- name: Set up QEMU
32-
uses: docker/setup-qemu-action@68827325e0b33c7199093565ac3b62264dc64a97
32+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
3333

3434
- name: Set up Docker Buildx
35-
uses: docker/setup-buildx-action@d70bba72b6f31a22640103738a088e5d3c8b4104
35+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
36+
37+
- name: Lowercase repository name
38+
id: repo_name
39+
run: echo "name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
3640

3741
- name: Build and push
38-
uses: docker/build-push-action@2cddeafc873d6113b789a7164923793f63101131
42+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
3943
with:
4044
context: .
4145
push: true
42-
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
46+
tags: ghcr.io/${{ steps.repo_name.outputs.name }}:${{ github.sha }}
4347
cache-from: type=gha
4448
cache-to: type=gha,mode=max
4549

4650
- name: Scan for vulnerabilities
47-
uses: aquasecurity/trivy-action@678a23d8ab761c56f6f59508935c1054363d11b3
51+
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
4852
with:
49-
image-ref: 'ghcr.io/${{ github.repository }}:${{ github.sha }}'
53+
image-ref: 'ghcr.io/${{ steps.repo_name.outputs.name }}:${{ github.sha }}'
5054
format: 'table'
5155
exit-code: '1'
5256
ignore-unfixed: true

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ WORKDIR /app
1111
COPY pyproject.toml poetry.lock* ./
1212
COPY src/ ./src/
1313

14-
# Export dependencies and install them, then install the project
15-
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes && \
16-
pip install --no-cache-dir --prefix="/install" -r requirements.txt && \
17-
poetry install --no-dev
14+
# Export dependencies and install them
15+
RUN mkdir -p /install && \
16+
poetry export -f requirements.txt --output requirements.txt --without-hashes && \
17+
pip install --no-cache-dir --prefix="/install" -r requirements.txt
1818

1919

2020
# Stage 2: Runtime

0 commit comments

Comments
 (0)