Skip to content

fix: docker pull fallback on linux amd64 for apple silicon #1104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 23, 2025

Conversation

sevbch
Copy link
Collaborator

@sevbch sevbch commented Jun 11, 2025

Context

A user reported the following issue on Apple Silicon:

ggshield secret scan docker bimapangestu/pertamina-login:latest
Saving docker image...
need to download image first
latest: Pulling from bimapangestu/pertamina-login
no matching manifest for linux/arm64/v8 in the manifest list entries

Error: Image "bimapangestu/pertamina-login:latest" not found

After pulling the image separately (using docker pull bimapangestu/pertamina-login:latest or docker pull --platform linux/amd64 bimapangestu/pertamina-login:latest), it ended working.

What has been done

When docker pull command fails, retry pulling specifically the linux/amd64 image.

Validation

Use case on Apple Silicon:

  • Make sure not to have locally pulled bimapangestu/pertamina-login:latest image (docker rmi -f bimapangestu/pertamina-login:latest)
  • run ggshield secret scan docker bimapangestu/pertamina-login:latest on main: command fails
  • On this branch: command works

Extra comment

I first added the fallback only for Apple Silicon OS and was advised to make it available for every kind of platform. I'm not opinionated on the topic.

PR check list

  • As much as possible, the changes include tests (unit and/or functional)
  • If the changes affect the end user (new feature, behavior change, bug fix) then the PR has a changelog entry (see doc/dev/getting-started.md). If the changes do not affect the end user, then the skip-changelog label has been added to the PR.

Copy link

codecov bot commented Jun 11, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.88%. Comparing base (bc4777c) to head (c8835dd).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
ggshield/verticals/secret/docker.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1104      +/-   ##
==========================================
- Coverage   91.89%   91.88%   -0.01%     
==========================================
  Files         144      144              
  Lines        6094     6102       +8     
==========================================
+ Hits         5600     5607       +7     
- Misses        494      495       +1     
Flag Coverage Δ
unittests 91.88% <90.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sevbch sevbch marked this pull request as ready for review June 20, 2025 12:54
@sevbch sevbch requested a review from a team as a code owner June 20, 2025 12:54
@sevbch sevbch force-pushed the severine/fix-pull-docker-apple-silicon branch from 9705fe6 to 6feb1bc Compare June 20, 2025 12:54
@sevbch sevbch self-assigned this Jun 20, 2025
@sevbch sevbch force-pushed the severine/fix-pull-docker-apple-silicon branch from 6feb1bc to 11dca33 Compare June 23, 2025 14:17
@sevbch sevbch enabled auto-merge June 23, 2025 14:17
@sevbch sevbch merged commit 95738b6 into main Jun 23, 2025
28 of 29 checks passed
@sevbch sevbch deleted the severine/fix-pull-docker-apple-silicon branch June 23, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants