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

armhf Dockerhub images fail to build #1048

Closed
nodiscc opened this issue Jan 5, 2018 · 9 comments
Closed

armhf Dockerhub images fail to build #1048

nodiscc opened this issue Jan 5, 2018 · 9 comments
Labels
bug it's broken! docker containers & cloud feedback needed

Comments

@nodiscc
Copy link
Member

nodiscc commented Jan 5, 2018

As shown on https://hub.docker.com/r/shaarli/shaarli/builds/, https://hub.docker.com/r/shaarli/shaarli/builds/bt4aqnydjrxyusqe8bmpjb3/, automatic builds of the armhf-latest and armhf-master images fail with:

Build failed: The command '/bin/sh -c apk --update --no-cache add ca-certificates curl nginx php7 php7-ctype php7-curl php7-fpm php7-gd php7-iconv php7-intl php7-json php7-mbstring php7-openssl php7-phar php7-session php7-xml php7-zlib s6' returned a non-zero code: 1
@nodiscc nodiscc added the docker containers & cloud label Jan 5, 2018
@virtualtam
Copy link
Member

virtualtam commented Jan 8, 2018

This is most likely an architecture limitation; Docker Hub resources used to build images are x86_64-based so building images for other platforms requires extra steps.

At a quick glance, the following solutions are available:

  • build images using an external service and publish them to the Docker Hub/Store
  • leverage the qemu emulator to generate images for other platforms

See:

I've disabled the corresponding automated builds for now (triggered on the non-existent noop branch).

We should properly document that Dockerfiles are available for the arm32v7 platform, and that it is up to the user to generate them on the corresponding system or emulator.

@immanuelfodor
Copy link

Yes, the build went seamlessly on the box itself with for example this command:

...Shaarli/docker/alpine# docker build -t shaarli-build-test -f Dockerfile.armhf.latest .

One idea that came to my mind is how the linuxserver.io guys are publishing all their armhf images on dockerhub, isn't there something in their repo(s), some config, some reference, etc that we could use to be able to run it automatically and without much hacks? I've never published anything on dockerhub, so I don't really know, just an idea.

@virtualtam
Copy link
Member

There are two ways of publishing images to the hub:

  • generating them locally, tagging them and pushing them to the hub
  • setting up automated builds so Docker images are built and tagged when the Git corresponding branches/tags are updated

I guess most automated ARM HF images are generated either using ARM build hosts, or using qemu for cross-platform image generation.

@immanuelfodor
Copy link

Oh, I see, thanks for the explanation!

@aashish108
Copy link

aashish108 commented Mar 30, 2022

Just to note that docker has a new experimental tool called buildx that builds images for other platforms. E.g. on x86 build for ARM. So it should be very easy to build & publish ARM images.

nodiscc added a commit that referenced this issue Aug 11, 2022
- python2 no longer available in alpine 3.16
- ref. #1048
@nodiscc
Copy link
Member Author

nodiscc commented Aug 11, 2022

After applying https://github.com/shaarli/Shaarli/pull/1869/files and a bit of trial and error, armhf images build correctly for me

$ docker buildx build -f Dockerfile.armhf .
# ...
# 0 3.234 exec /bin/sh: exec format error

$ sudo apt install -y qemu-user-static binfmt-support
$ docker buildx build -f Dockerfile.armhf .
# ...
# 0 2.731 ERROR: unable to select packages:                                                                                                                     
# 0 2.799   py2-pip (no such package):                                                                                                                          

$ sed -i 's/py2/py3/g' Dockerfile.armhf
$ sed -i 's/python2/python3/g' Dockerfile.armhf
$ docker buildx build -f Dockerfile.armhf .
# ...
# => => writing image sha256:9396bc0f2dd81728d5c2f635c790a74a9dd4935d227ace41d49a48195eaf6cd9                                                              0.0s 

Building for armhf on an amd64 machine with buildx is noticeably slower, but it works. I have added the required changes to the already open PR #1869.

I have no ARM machine to test deploying/running it. Can someone clone the docker-alpine-php8 branch, build the armhf image, deploy it, and tell us if everything appears to be working properly?

nodiscc added a commit that referenced this issue Sep 4, 2022
- python2 no longer available in alpine 3.16
- ref. #1048
nodiscc added a commit that referenced this issue Sep 24, 2022
- python2 no longer available in alpine 3.16
- ref. #1048
@nodiscc
Copy link
Member Author

nodiscc commented Sep 26, 2022

@nodiscc nodiscc removed their assignment Sep 26, 2022
@nodiscc
Copy link
Member Author

nodiscc commented Mar 21, 2023

Related #1962

@nodiscc
Copy link
Member Author

nodiscc commented Mar 21, 2023

Dockerfile.armhf was removed in #1962 and the official shaarli/shaarli:latest image should now work on armhf (or not? I'm a bit lost with ARM architecture naming conventions) - please test if you have a suitable machine.

Anyway this issue was about Dockerfile.armhf not working properly, so closing. Feel free to open a new issue if you think a new architecture should be added.

@nodiscc nodiscc closed this as completed Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug it's broken! docker containers & cloud feedback needed
Projects
None yet
Development

No branches or pull requests

4 participants