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

Build Docker images that contain both amd64 and /arm/v7 #1496

Closed
wants to merge 3 commits into from
Closed

Build Docker images that contain both amd64 and /arm/v7 #1496

wants to merge 3 commits into from

Conversation

cerebrate
Copy link

@cerebrate cerebrate commented Jun 29, 2020

This PR removes the separate Dockerfile for armhf and amends the primary Dockerfile to build successfully for both amd64 and arm/v7, then adds a Docker command to build and push a multiarch image as an additional makefile option, docker_image .

In addition to simplifying the build process, this produces a single Docker image which can be executed on either amd64 or arm/v7 architectures, which avoids the need to find the image for the other arch under a different name, and is particularly useful for those of us running mixed-architecture clusters.

(An example image produced by the below is cerebrate/shaarli .)

@ArthurHoaro
Copy link
Member

Thanks for your contribution. The build is working fine, however Docker buildx is an experimental feature that has only had been included with Docker in the latest version. Also, it's not enabled by default, so I'd rather wait before merging it.

@ArthurHoaro ArthurHoaro added the docker containers & cloud label Aug 27, 2020
e2jk added a commit to e2jk/Shaarli that referenced this pull request Dec 6, 2020
The Docker for armhf doesn't build anymore on Alpine 3.8, upgrading to 3.10.
Building works fine on a Rapsberry Pi 4 running Raspbian GNU/Linux 10 (buster)



This is the error with 3.8:
```
[2/4] Fetching packages...
error css-loader@4.3.0: The engine "node" is incompatible with this module. Expected version ">= 10.13.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c apk --update --no-cache add yarn nodejs-current python2 build-base     && cd /shaarli     && yarn install     && yarn run build     && rm -rf node_modules' returned a non-zero code: 1
```


Not upgrading to 3.11, due to this error:
```
2/4] Fetching packages...
error browserslist@4.14.3: The engine "node" is incompatible with this module. Expected version "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7". Got "13.1.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

The command '/bin/sh -c apk --update --no-cache add yarn nodejs-current python2 build-base     && cd /shaarli     && yarn install     && yarn run build     && rm -rf node_modules' returned a non-zero code: 1
```


Not upgrading to 3.12 either, due to this error:
```
ERROR: unsatisfiable constraints:
  py2-pip (missing):
    required by: world[py2-pip]
The command '/bin/sh -c apk --update --no-cache add py2-pip     && cd /usr/src/app/shaarli     && pip install --no-cache-dir mkdocs     && mkdocs build --clean' returned a non-zero code: 1
```
There's probably a way to have Python2 pip installed on 3.12, but I suppose other issues would arise (such as the one happening with 3.11), so only proposing to upgrade to 3.10 now. This would probably be looked at more in detail when merging the amd64 and arm/v7 Docker builds, see shaarli#1496.
@nodiscc
Copy link
Member

nodiscc commented Jan 14, 2022

@cerebrate can you please rebase your changes on top of master?
Docker Buildx is no longer marked experimental.

@nodiscc
Copy link
Member

nodiscc commented Mar 21, 2023

PR #1962 replaces this one.

@nodiscc nodiscc closed this Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker containers & cloud
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants