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

Multiarchitecture support (arm, arm64) #376

Open
samip5 opened this issue Jun 25, 2021 · 15 comments
Open

Multiarchitecture support (arm, arm64) #376

samip5 opened this issue Jun 25, 2021 · 15 comments

Comments

@samip5
Copy link

samip5 commented Jun 25, 2021

This docker image needs multi-architecture builds so that it can be run on other architecture as well.

@llacroix
Copy link

llacroix commented Jul 6, 2021

Anything particular is needed for arm support? I wouldn't mind adding arm support to my fork but I have no way to try this out.

@samip5
Copy link
Author

samip5 commented Jul 6, 2021

Anything particular is needed for arm support? I wouldn't mind adding arm support to my fork but I have no way to try this out.

Tehnically you only need to make multi-architecture images of it.
Google will tell you how it's done.

@llacroix
Copy link

llacroix commented Jul 7, 2021

From what I could gather, there is no "multi arch" image but more or less multiple images on the same tag through a multi manifest.

It doesn't seem to be possible to easily cross compile an arm image from amd64. So I'd need a VM or an actual device with ARM to build the images myself... Maybe docker hub is smart enough to select a build server on arm based on the docker file. I'll have to try that. Otherwise I just can't seem to build it.

@samip5
Copy link
Author

samip5 commented Jul 7, 2021

From what I could gather, there is no "multi arch" image but more or less multiple images on the same tag through a multi manifest.

It doesn't seem to be possible to easily cross compile an arm image from amd64. So I'd need a VM or an actual device with ARM to build the images myself... Maybe docker hub is smart enough to select a build server on arm based on the docker file. I'll have to try that. Otherwise I just can't seem to build it.

Docker hub's automated builder is not smart enough, and thus cannot build other architecture images.

@llacroix
Copy link

llacroix commented Jul 7, 2021

Hmm but I think my issue is a bit different...

STEP 5: RUN set -x;         apt-get update         && apt-get install -y --no-install-recommends             python3-wheel             python3-setuptools             python3-pip             curl             gnupg             libpq-dev             libsasl2-2             libldap-2.4-2             libxml2             libxmlsec1             libxslt1.1             sudo             node-less         && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 2         && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb         && apt-get install -y --no-install-recommends ./wkhtmltox.deb         && rm -rf /var/lib/apt/lists/* wkhtmltox.deb
standard_init_linux.go:228: exec user process caused: exec format error
Error: error building at STEP "RUN set -x;         apt-get update         && apt-get install -y --no-install-recommends             python3-wheel             python3-setuptools             python3-pip             curl             gnupg             libpq-dev             libsasl2-2             libldap-2.4-2             libxml2             libxmlsec1             libxslt1.1             sudo             node-less         && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 2         && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb         && apt-get install -y --no-install-recommends ./wkhtmltox.deb         && rm -rf /var/lib/apt/lists/* wkhtmltox.deb":
 error while running runtime: exit status 1

I'll have to remove wkhtmltopdf as there are no arm build as far as I know. That said, I do have a wkhtmltopdf server that can be used transparently to point to a remote pdf server... that's a possibility to use as replacement for pdf.

Edit:

There is 0.12.6r1

@samip5
Copy link
Author

samip5 commented Jul 7, 2021

Hmm but I think my issue is a bit different...

STEP 5: RUN set -x;         apt-get update         && apt-get install -y --no-install-recommends             python3-wheel             python3-setuptools             python3-pip             curl             gnupg             libpq-dev             libsasl2-2             libldap-2.4-2             libxml2             libxmlsec1             libxslt1.1             sudo             node-less         && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 2         && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb         && apt-get install -y --no-install-recommends ./wkhtmltox.deb         && rm -rf /var/lib/apt/lists/* wkhtmltox.deb
standard_init_linux.go:228: exec user process caused: exec format error
Error: error building at STEP "RUN set -x;         apt-get update         && apt-get install -y --no-install-recommends             python3-wheel             python3-setuptools             python3-pip             curl             gnupg             libpq-dev             libsasl2-2             libldap-2.4-2             libxml2             libxmlsec1             libxslt1.1             sudo             node-less         && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1         && update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 2         && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb         && apt-get install -y --no-install-recommends ./wkhtmltox.deb         && rm -rf /var/lib/apt/lists/* wkhtmltox.deb": error while running runtime: exit status 1

I'll have to remove wkhtmltopdf as there are no arm build as far as I know. That said, I do have a wkhtmltopdf server that can be used transparently to point to a remote pdf server... that's a possibility to use as replacement for pdf.

Umm, it sounds like youre trying to build it incorrectly.

You need to use Docker's buildx functionality most likely.

@llacroix
Copy link

llacroix commented Jul 7, 2021

Hmm okay, I'll have to update my build script to use buildx but I think it should work transparently. I have a proof of concept that downloads the proper deb file for wkhtmltox.
That said It's still unclear what else could go wrong with python deps.

@leimantas
Copy link

leimantas commented Aug 20, 2021

RUN WKH_VERSION=$([ "$(uname -m)" = 'aarch64' ] && echo "arm64" || echo "amd64") \ && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_${WKH_VERSION}.deb

I made this change to original image. And it works.

https://hub.docker.com/r/wbms/odoo14-multiarch

Build command: docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag wbms/odoo14-multiarch:latest .

@llacroix
Copy link

I've got some progress on that btw, the only small issue is mainly that for some reasons docker buildx doesnt want to push to a private repository... I haven't figured out why yet but it's also possible to work with other versions than 0.12.6-1

I'm finishing how to improve the version selection of wkhtmltopdf to install and then I think I'll be able to push the docker images in multi arch once I get buildx to push images.

@nischi
Copy link

nischi commented Nov 2, 2021

It would be really nice if this is will be in the official image. Is there any plans to do so?
We do need it for our developers with MacBook and M1 chips.

@ExtremeXBB
Copy link

RUN WKH_VERSION=$([ "$(uname -m)" = 'aarch64' ] && echo "arm64" || echo "amd64") \ && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_${WKH_VERSION}.deb

I made this change to original image. And it works.

https://hub.docker.com/r/wbms/odoo14-multiarch

Build command: docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag wbms/odoo14-multiarch:latest .

I am using the odoo 15.0, modified the dockerfile similar to this and built it.
It works good on my RaspberryPi 4 running with raspios arm64.

@sanderkwantes
Copy link

Multi architecture support is also made possible with merge request #399.

@gustavovalverde
Copy link

Thanks for this.

I'm using this approach to workaround the wkhtmltopdf: https://github.com/iterativo-git/dockerdoo/blob/13.0/Dockerfile#L55-L61

And building for both platforms using https://github.com/iterativo-git/dockerdoo/blob/13.0/.github/workflows/tests.yaml#L138

@derfl0
Copy link

derfl0 commented Apr 10, 2022

Let me throw one more option into the ring: separate images for arm ( #410 )

Tested on a M1 and it seems to work

@samip5
Copy link
Author

samip5 commented Sep 14, 2023

Let's see if this gets merged:

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

8 participants