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

How to use a base_image with multiple-platforms for aarch64? #113

Open
laoshanxi opened this issue Mar 4, 2023 · 5 comments
Open

How to use a base_image with multiple-platforms for aarch64? #113

laoshanxi opened this issue Mar 4, 2023 · 5 comments

Comments

@laoshanxi
Copy link

laoshanxi commented Mar 4, 2023

I am trying this to run arm64 docker container, but seems I can not get a QMENU ARM64 environment, still X86 runner, is there anything wrong with my configuration?

action output:
https://github.com/laoshanxi/app-mesh/actions/runs/4329800139/jobs/7560595971

workflow:

      - name: build with ubuntu18 ARM64
        uses: uraimo/[email protected]
        with:
          arch: aarch64
          distro: ubuntu_latest
          githubToken: ${{ github.token }}
          dockerRunArgs: |
            --volume ${{ github.workspace }}:/workspace --workdir /workspace
          base_image: laoshanxi/appmesh:build_ubuntu18
          shell: /bin/sh
          run: |
            mkdir ubuntu18arm
            cd ubuntu18arm
            cmake ..
            make -j4
            make pack
            ls
            make test ARGS='-V'

image

and also I founc $(arch) return x86_64.

BTW, the base_image laoshanxi/appmesh:build_ubuntu18 here have arm64 and x86_64 platforms, so how can I force specify arm64 to run this base image?
image

@laoshanxi laoshanxi changed the title aarch64 used X86_64 platform aarch64 used x86_64 platform Mar 4, 2023
@laoshanxi laoshanxi changed the title aarch64 used x86_64 platform How to use a base_image with multiple-platforms for aarch64? Mar 5, 2023
@uraimo
Copy link
Owner

uraimo commented Mar 7, 2023

Hi, yes, the problem is that the image is multi-platform and the action doesn't allow to explicitly specify the architecture. Adding support for --platform could be useful also for images that don't specify the architecture, but in this release I don't plan to add any more parameters.

AFAIK, you could select a specific version of the image adding the digest like <username>/<image>:latest@sha256:<digest> but since the digest changes you'll need to retrieve it with docker inspect every time and pass it to the run-on-arch job. It seems like it should work but I'm not sure if it's doable.

@laoshanxi
Copy link
Author

laoshanxi commented Mar 8, 2023

Will we plan support apply parameter arch: aarch64 when specified base_image ?

I saw from README, mentioned.

base_image: Specify a custom base image, such as [busybox](https://hub.docker.com/_/busybox), arch and distro should be set to none in this case.

#103 (comment)

@uraimo
Copy link
Owner

uraimo commented Mar 8, 2023

Yes, I will give a better name to the parameters but that's the idea, if you don't use the default images you can optionally specify a platform for the base_image.

@grimbough
Copy link

grimbough commented Mar 31, 2023

I think you can do this by just specifying --platform=linux/arm64 as part of the base_image argument e.g.

base_image: --platform=linux/arm64 bioconductor/bioconductor_docker:RELEASE_3_16

That seems to work for me e.g. https://github.com/grimbough/arm64-workflow/actions/runs/4568897053/jobs/8064509304#step:3:112

@laoshanxi
Copy link
Author

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

No branches or pull requests

3 participants