Tecnativa / doodba

Base image for making the creation of customized Odoo environments a piece of cake
Apache License 2.0
432 stars 303 forks source link

Cannot build V 17.0 on ARM64 #610

Open bosd opened 6 months ago

bosd commented 6 months ago

Describe the bug

Unable to build on a ARM vps.

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Setup a project with the copier template
  2. inv img-build

See

``` WARN[0000] /root/sarm/docker-compose.yml: `version` is obsolete [+] Building 0.7s (6/9) docker:default => [odoo internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 108B 0.0s => [odoo internal] load metadata for ghcr.io/tecnativa/doodba:17.0-onbuild 0.4s => [odoo internal] load .dockerignore 0.0s => => transferring context: 159B 0.0s => CACHED [odoo 1/1] FROM ghcr.io/tecnativa/doodba:17.0-onbuild@sha256:5a97edffb93b96a55894278221554dbbd95bf2fd0d61313f6f53fdc63 0.0s => ERROR [odoo 2/1] RUN groupadd -g 0 odoo -o && useradd -l -md /home/odoo -s /bin/false -u 0 -g 0 odoo && mkdir -p /var 0.2s => CANCELED [odoo internal] load build context 0.2s => => transferring context: 702B 0.2s ------ > [odoo 2/1] RUN groupadd -g 0 odoo -o && useradd -l -md /home/odoo -s /bin/false -u 0 -g 0 odoo && mkdir -p /var/lib/odoo && chown -R odoo:odoo /var/lib/odoo /qa/artifacts && chmod a=rwX /qa/artifacts && sync: 0.160 exec /bin/sh: exec format error ------ failed to solve: process "/bin/sh -c groupadd -g $GID odoo -o && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo && mkdir -p /var/lib/odoo && chown -R odoo:odoo /var/lib/odoo /qa/artifacts && chmod a=rwX /qa/artifacts && sync" did not complete successfully: exit code: 1 ```

Expected behavior An running doodba iage.

Additional context Docker version 26.0.0, build 2ae903e Ubuntu 24.04 LTS aarch64

bosd commented 6 months ago

Even tried export DOCKER_DEFAULT_PLATFORM=linux/arm64/v8 && docker compose -f prod.yaml up It got passed the previous error. But now there is an enldess: db-1 | exec /autoconf-entrypoint: exec format error

pedrobaeza commented 6 months ago

Not an expert on ARM. Maybe @PCatinean can say anything about this.

ap-wtioit commented 6 months ago

@bosd your reported error looks like it's coming from the postgres image, have you checked if there is an arm version available?

Update: ok there should be plenty of images in the dockerhub postgres for arm: https://hub.docker.com/_/postgres/tags but https://hub.docker.com/r/tecnativa/postgres-autoconf/tags doesn't have arm tags. Can you switch https://github.com/Tecnativa/doodba-scaffolding/blob/master/common.yaml#L31 to image: postgres:${DB_VERSION}-alpine

bosd commented 6 months ago

@ap-wtioit Thanks for the pointer. Found out there was a specific image for arm64/v8 which was unavailable in the main repo. So changing the line to:

image: arm64v8/postgres:15-alpine

Fixed it. IDK, how and if this should be incorporated into the template.

FYI: Still not having a complete arm production setup runing. Still trying to get the inverseproxy up and running.