planner icon indicating copy to clipboard operation
planner copied to clipboard

Apple Silicon support for Docker

Open biggianteye opened this issue 1 year ago • 4 comments

Building the application using Docker on Apple Silicon (M1, M2, etc) fails with the following error in the step where it attempts to install Google Chrome:

7.332 + apt-get install -y --force-yes google-chrome-stable --no-install-recommends
7.341 Reading package lists...
7.723 Building dependency tree...
7.805 Reading state information...
7.864 W: --force-yes is deprecated, use one of the options starting with --allow instead.
7.864 E: Unable to locate package google-chrome-stable
------
failed to solve: process "/bin/sh -c set -ex;     wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -     && wget -q -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -     && sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google.list'     && apt-get update     && apt-get install -y --force-yes google-chrome-stable --no-install-recommends     && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100

By default, Docker will use images that match the host architecture (ie. linux/arm64/v8 on Apple Silicon). The above apt repo does not have an ARM version of Google Chrome.

This PR addresses the problem by making it explicit that Docker should always use the linux/amd64 versions of images.

It also addresses another Apple Silicon-related error message and a bundler-related warning. See the individual commit messages for more details.


Note that the main goal of this PR is to get building of the project to complete via Docker.

biggianteye avatar Aug 12 '23 22:08 biggianteye

I have rebased this PR against the latest codebar/planner code and tested it on my M1 machine and it still works as expected.

biggianteye avatar May 03 '24 21:05 biggianteye

@matyikriszta Is there anything I can do to help towards getting this PR merged?

biggianteye avatar May 14 '24 19:05 biggianteye

Hi @biggianteye

Nice work. Indeed current state of the docker file is not working on Mac M_x machines.

Firstly, I thought maybe we could instead of changing platform allow it to be native and install an appropriate google chrome version from chrome for testing site

But as the browser inside docker is only used for testing and from my perspective it's ok to use builtin chrome version (as it's quite fresh and is not drastically different in terms of web standards).

So, I made a PR where I simply remove this line from the Dockerfile.

Not sure what is better though.

Rukomoynikov avatar May 30 '24 20:05 Rukomoynikov

@biggianteye thanks for your patience, this is on our radar and we'll do our best to test and approve as soon as possible

matyikriszta avatar Jun 25 '24 17:06 matyikriszta

@biggianteye thanks for your work on this. I've opened a PR at https://github.com/codebar/planner/pull/2103 that fixed up the following issue in a slightly different way. If that PR gets approved and merged I'm going to close this one. I appreciate you following up on this issue.

matyikriszta avatar Jul 29 '24 04:07 matyikriszta