-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support for docker platform architecture when pulling multi-platform images #62
Comments
This should be fairly easy to implement considering ImagePullOptions in the Docker client API exposes Platform. |
what's the workaround for this right now if im on the wrong platform? |
In CI, we're running sinker in a docker container on the correct architecture. Locally we added a bit of a safety net in the the Makefile, since the consequences could be pretty bad. ifeq ($(UNAME), arm64)
$(error Warning: Don't use sinker push on ARM architecture)
endif
sinker push |
A coworker at our shop found a workaround (similar to @dewe's). We are using colima delete && colima start --arch x86_64
# ensure docker is running as expected
docker info | grep -i arch
# sync images as usual
sinker push --dryrun If you want to configure that architecture in a colima config file instead of a startup flag, see this |
@dewe @kr3cj The new does something like:
|
Looks promising! |
Would love to hear your feedback and see if it works out for you! After using it some myself as of late I'm leaning towards providing some sensible default for the architecture and os when using the command, and it may be more succinct to use a flag similar to your original proposal ( |
I did a quick check with $ sinker copy -m .images.generated.yaml --override-arch amd64 --override-os linux
INFO[0000] Finding images that need to be copied ...
INFO[0001] Copying image ghcr.io/fluxcd/image-automation-controller:v0.22.1 to [redacted].dkr.ecr.eu-west-1.amazonaws.com/fluxcd/image-automation-controller:v0.22.1
Error: copy: copy image: trying to reuse blob sha256:df9b9388f04ad6279a7410b85cedfdcb2208c0a003da7ab5613af71079148139 at destination: checking whether a blob sha256:df9b9388f04ad6279a7410b85cedfdcb2208c0a003da7ab5613af71079148139 exists in [redacted].dkr.ecr.eu-west-1.amazonaws.com/fluxcd/image-automation-controller: unauthorized: authentication required Just to rule out any setup issues, I ran a $ sinker push -m .images.generated.yaml
INFO[0000] Finding images that need to be pushed ...
INFO[0000] Pulling ghcr.io/fluxcd/image-automation-controller:v0.22.1
INFO[0004] Pushing [redacted].dkr.ecr.eu-west-1.amazonaws.com/fluxcd/image-automation-controller:v0.22.1
INFO[0010] All images have been pushed!
Yes, I think it is logical to use the same flag as |
Following up my own comment, here's a couple tools I found that are working for me:
|
@deeTEEcee does the new command and flags work for you? #62 (comment) or anything else that needs supported to solve your use case? |
ah i didnt realize that copy command was already released. Is " Overall, I'm just looking for something that allows me to do a simple command like: |
I currently have the same issue as @dewe in #62 (comment) - we have some workflow where we copy images to our AWS ECR. We wrote some nice bash script wrapper around sinker which collect the images and so on.
When using Workaround is using |
Running
sinker push
automatically pulls the image version matching the local machine. This is fine as long as the local machine (or CI build server) runs on the same architecture as the servers running the workload.But if I happen to run
sinker push
on my M1 Mac, I'll silently push a bunch oflinux/arm64
images to the repo. This can result in the runtime environment pulling bad images, and workloads unable to start.It would be good to be able to specify the expected platform when pulling and pushing with sinker:
The text was updated successfully, but these errors were encountered: