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

Apple Silicon support for Docker #1900

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

biggianteye
Copy link
Contributor

@biggianteye biggianteye commented Aug 12, 2023

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 biggianteye changed the title Apple silicon support Apple Silicon support Aug 13, 2023
Dockerfile Show resolved Hide resolved
Here is the warning:

  Warning: the running version of Bundler (2.1.4) is older than the version that
  created the lockfile (2.4.17).
Without this setting enabled, you will get the following fatal error every time
you try to run a rake command in docker:

  Errno::ENOSYS: Function not implemented - Failed to initialize inotify
  /usr/local/bundle/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:69:in `initialize'

See evilmartians/terraforming-rails#34 for a
description of the problem.
@biggianteye
Copy link
Contributor Author

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 biggianteye changed the title Apple Silicon support Apple Silicon support for Docker May 3, 2024
@biggianteye
Copy link
Contributor Author

@matyikriszta Is there anything I can do to help towards getting this PR 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

Successfully merging this pull request may close these issues.

None yet

3 participants