Skip to content
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

Multi-Arch experiment #33

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Multi-Arch experiment #33

wants to merge 1 commit into from

Conversation

kriscfoster
Copy link
Owner

@kriscfoster kriscfoster commented Oct 6, 2023

This is an experiment based from curiosity of bazel-contrib/rules_oci#325.

It looks like there are some gaps but it is possible to make it work in some way..

The expected tag of the image does not work, but referencing the image ID does work as expected.

➜ bazel run projects/go_web:multi_arch_tarball
➜ docker images | grep projects/go_web
projects/go_web                    oci_tarball_multi_arch   d76e9c38d7ed   21 minutes ago   56.3MB
...
➜  docker run --platform linux/amd64 d76e9c38d7ed 
2023/10/06 13:58:16 running program's operating system target: linux
2023/10/06 13:58:16 running program's architecture target: amd64
2023/10/06 13:58:16 Going to listen on port: 8080
...                                                                                            
➜  docker run --platform linux/arm64 d76e9c38d7ed
2023/10/06 13:58:25 running program's operating system target: linux
2023/10/06 13:58:25 running program's architecture target: arm64
2023/10/06 13:58:25 Going to listen on port: 8080

You can also make it work if you re-tag the image..

➜  docker tag d76e9c38d7ed my-image:1     
...                                                                                                                                                                           
➜  docker run --platform linux/arm64 my-image:1 
2023/10/06 14:01:37 running program's operating system target: linux
2023/10/06 14:01:37 running program's architecture target: arm64
2023/10/06 14:01:37 Going to listen on port: 8080
...                                                                                              
➜  docker run --platform linux/amd64 my-image:1
2023/10/06 14:01:42 running program's operating system target: linux
2023/10/06 14:01:42 running program's architecture target: amd64
2023/10/06 14:01:42 Going to listen on port: 8080

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.

1 participant