Make Dockerfile compatible with ARM#84
Make Dockerfile compatible with ARM#84JoaoNogueira-xyz wants to merge 7 commits intothirtythreeforty:masterfrom JoaoNogueira-xyz:master
Conversation
|
Can I ask how you build this for arm within github actions without using a raspberry pi? Perhaps I'm missing something. |
|
I think youd need to also make the GitHub action part use qemu and xbuild too. Could you have a look at the changes I tried in #76 and add those to the docker.yml in GitHub actions. Your best way to test is to use GitHub actions in your own repo. |
|
Something like this - name: Set up QEMU
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/setup-buildx-action@v1
- name: Login to dockerhub
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/login-action@v1
with:
username: ${{ steps.string_user.outputs.lowercase }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Get tag name
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
id: tags
run: |
branch="${GITHUB_REF#refs/heads/}"
tags="${REPO_NAME}:${branch}"
if [ "${branch}" == "master" ]; then
tags="${tags},${REPO_NAME}:latest"
fi
echo "::set-output name=TAGS::${tags}"
env:
REPO_NAME: ${{ steps.string_repo.outputs.lowercase }}
- name: Push to Docker Hub Debian
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
uses: docker/build-push-action@v2
with:
platforms: linux/arm/v7,linux/amd64
push: true
file: Dockerfile
tags: ${{ steps.tags.outputs.TAGS }}So that the build machine makes both images before publishing to dockerhub |
|
I would be interested in seeing if the alpine also runs into the qemu issues I was having #76 with the cargo build step failing due to inode sizes |
This reverts commit ab266de.
|
You are correct, I was missing the github actions' configs and your suggestion seems to be working. I created a docker hub repo to test it (https://hub.docker.com/r/joaonogueira114/neolink) and I am currently using that image on my raspberry pi and it is performing as expected. |
|
Could you try with armv6 too. I had already gotten amd64/armv7/armv8 working. It was just armv6 for someone on a raspberry pi 1 that was causing me trouble. |
|
I think I can see from your commit that you are trying to split armv6 out as its own build. When I tried something similar it overwrote the build on dockerhub rather than added to it. I'm sure there's a way to do it but I didn't look into it. Please tell me if you can manage this as I'd be interested. Also are you breaking it out as its own build due to the build time? I found armv6 took over 7 hours. If we can get it to publish incrementally to docker hub maybe using a matrix would be more efficient than I seperate job. |
|
Yes, that is what I was trying to do. When I bundled all builds together it timed out at 6h, however when I split them the times are:
I had never used github actions before so I am not sure yet what is causing this issues. But I will look into it in the next couple of days. |
|
I think the overriding is part of docker rather than GitHub. I suspect that there is an option in docker to tell it to add to a published build but I haven't looked into it either yet. |
|
This link seems to suggest that we build to different tags then crate a manifest that points to this different tags |
|
Rather than making the manifest as described in that link we could go down the route of build on docker in GitHub job 1 and save the binary as an artifact. Then in job 2 cp in the binary to the docker and publish. |
|
Personally though I think this is more effort then it is worth. Let's just leave it as amd64 and armv7 and add others at a later date. |
|
I may take a final look during the weekend but ultimately I agree with you. Releasing it for amd64/armv7/armv8 will probably be enough for most users. |
|
I've just noticed your docker-arm-v6.yaml the way this is setup won't it ovewrite the amd64/armhf/arm64 image on dockerhub when it gets pushed. I think perhaps we should remove that before merging this |
Docker image docker.io/rust:1-alpine was not compatible with ARM.
Using the base image docker.io/alpine and installing rust instead will allow the image to be build for both ARM and x86.
Tested and working on a Pi model 3B, running Raspbian GNU/Linux 9.13
Closes #73