Help

1

Odoo docker apple M1

Avatar
Roger Escola Belarte

I was thinking in a future to update my mac or not. Now they're using ARM architecture and I was worried about working with docker containers to run and code odoo.

Anyone with mac M1 can say if it's possible or there's any inconvenience?

Thanks a lot

1Opmerking
Avatar
Negeren
Avatar
Omydoo
-

Hello, why have Odoo locally? Maybe it's better to put it on a server, right? And you would no longer have a Mac version problem

4Antwoorden
2
Avatar
Roger Escola Belarte
Beste antwoord

Tanks Omydoo. But its clear that its runing on a server. But when i have to change something I dont develop on server instance. I download locally and change it here to later upload to server. Now i can do that and test after using docker on my mac if all was correct I upload to customer server. Now i dont know if its possible on M1

Avatar
Negeren
0
Avatar
leofisher
Beste antwoord

Hi,

You can run try to run the command below, seems to work correctly when using the --platform argument as well as download the m1 preview image. 

Source: https://github.com/odoo/docker/issues/349#issuecomment-757472030

docker pull odoo:14 --platform linux/arm64

Same thing for postgress DB image

docker pull postgres:12 --platform linux/arm64
2Opmerkingen
Avatar
Negeren
Avatar
leofisher
-

same thing as well for the postgress DB:

`docker pull postgres:12 --platform linux/amd64`

Postgres image support arm architecture odoo image don't.

For me works including the platform option in docker-compose file like this, only in the odoo section:

...
web:
image: odoo:15.0
platform: linux/amd64
depends_on:
- db
ports:
- "8015:8069"
...

Tested in MacBook Air M1. Hope it helps!

0
Beste antwoord

Hello, IDK if you have solved your issue, but I currently develop on Odoo on my M1 mac, basically, I made a duplicate of my terminal app, and in the get info menu, you can click on "Run using rosseta", then, I installed a second instance of Homebrew using this terminal (It installs it somewhere else on the system when it's an x86 app), and installed pipenv (similiar to venv) for python, Then on a directory, I ran pipenv shell passing the Python version that I want to use (must be different than system default), and pipenv downloads that python version but using x86. After all of this is done, you will see a Pipfile on the directory you were on, to activate this environment you just have to type pipenv shell on the same dir as the Pipfile, when using this environment, all python code will be executed using rosseta, so you can install requirements and run Odoo without containers or some other workarounds. If this is useful and needs more explanation, let me know.

Avatar
Negeren
0
Avatar
daffodilistic
Beste antwoord

You would likely need to build a custom Docker image. In my case, I had to build a custom Docker image for Odoo v10 CE.

You can use a sample Dockerfile I've created here:

https://github.com/daffodilistic/docker-odoo/blob/10.0/10.0/Dockerfile
Avatar
Negeren