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

Publish Docker images for ARM architecture #568

Closed
ngosang opened this issue Oct 11, 2021 · 8 comments
Closed

Publish Docker images for ARM architecture #568

ngosang opened this issue Oct 11, 2021 · 8 comments

Comments

@ngosang
Copy link

ngosang commented Oct 11, 2021

Publish Docker images for ARM architecture in https://hub.docker.com/r/healthchecks/healthchecks/tags

GitHub Actions example => https://github.com/ngosang/urbackup-exporter/blob/master/.github/workflows/release-docker.yml#L103

@cuu508
Copy link
Member

cuu508 commented Oct 12, 2021

Building cryptography on arm/v7 throws an error, not sure how to fix it:

https://github.com/healthchecks/healthchecks/runs/3866973629?check_suite_focus=true#step:7:3563

I can also reproduce the problem locally:

cp docker/Dockerfile .
docker buildx build --platform linux/arm/v7 -t arm-build .

It produces the same error message:

#11 226.6   generating cffi module 'build/temp.linux-armv7l-3.9/_openssl.c'
#11 226.6   creating build/temp.linux-armv7l-3.9
#11 226.6   running build_rust
#11 226.6       Updating crates.io index
[...]
#11 226.6   subprocess.CalledProcessError: Command '['cargo', 'metadata', '--manifest-path', 'src/rust/Cargo.toml', '--format-version', '1']' died with <Signals.SIGSEGV: 11>.
#11 226.6   ----------------------------------------
#11 226.6   ERROR: Failed building wheel for cryptography

@ngosang
Copy link
Author

ngosang commented Oct 12, 2021

@cuu508 take a look here, they are skipping that dependency with an environment variable => https://github.com/linuxserver/docker-healthchecks/blob/master/Dockerfile.aarch64

Since linuxserver provides Docker images for AMD64, ARM and ARM64 it is possible to archive.

@cuu508
Copy link
Member

cuu508 commented Oct 12, 2021

Unfortunately CRYPTOGRAPHY_DONT_BUILD_RUST does not work any more with cryptography >= 35.0.0, see #565

@ngosang
Copy link
Author

ngosang commented Oct 12, 2021

They are publishing latest release (1.22.0) for ARM using the Dockerfile from my previous comment.
https://hub.docker.com/r/linuxserver/healthchecks/tags
Those images are working fine.

@cuu508
Copy link
Member

cuu508 commented Oct 12, 2021

They install dependencies like so:

pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ -r requirements.txt 

If you look at https://wheel-index.linuxserver.io/alpine/, it has a prebuilt wheel for cryptography==35.0.0, armv7l. I guess that's how they get around building it from source and hitting the rust issue.

@cuu508
Copy link
Member

cuu508 commented Oct 12, 2021

Found issues with people hitting the same error: pyca/cryptography#6347 and docker/buildx#395 (comment)

@cuu508
Copy link
Member

cuu508 commented Oct 13, 2021

To work around the cryptography-rust-buildx-qemu issue I updated the Dockerfile to use piwheels.org repo (but only when the architecture is armhf): 1b0f5e9

I released v1.23.1 with these changes. Three architectures are now available on Docker Hub linux/amd64, linux/arm/v7 and linux/arm64. I have tested the first two and they seem to nominally work.

@cuu508 cuu508 closed this as completed Oct 13, 2021
@ngosang
Copy link
Author

ngosang commented Oct 13, 2021

@cuu508 Thank you, that was fast!
I'm still using the Linuxserver Docker image in production because is critical for me, but I will use the official Docker image eventually. I will report any issue then.

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

2 participants