Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Conversation

@SimmonsRitchie
Copy link
Contributor

@SimmonsRitchie SimmonsRitchie commented Mar 5, 2022

What's this PR do?

Fixes a bug that causes make -f Makefile.dev to fail on macs with M1 (ie. "Apple Silicon") chips.

The problem appears to relate to our use of node:12-alpine in our Docker image build. The problem (and solution) is described here.

Why are we doing this? How does it help us?

An alternative solution to this bug is to just use Docker's node:12 image in our Dockerfile rather than the node:12-alpine variant. However, given the security benefits of the alpine linux distro, and its general lightweight nature, the solution in this PR is considered preferable. It allows us to continue using alpine.

How should this be manually tested?

Follow the normal steps to run this repo locally:

  1. make db-refresh -f Makefile.dev: Using your AWS credentials, this loads a dump of the production database into your local environment.
  2. make -f Makefile.dev: Build the Docker image locally, and run a container with bash as the entrypoint.
  3. npm run build: Compile JavaScript using Webpack and TypeScript.
  4. npm run start:watch: Run the app, using Nodemon to watch for Node file changes and Webpack Dev Middleware to watch for front-end file changes.
  5. Visit /dashboard/.

If everything is normal, then all is well. Preferably these steps should be followed on a mac with a M1 chip in addition to a mac with a amd64 chip.

How should this change be communicated to end users?

N/A

Are there any smells or added technical debt to note?

We should probably be using a more recent version of node (we're using 12, node is now up to version 17). However, since that upgrade might cause dependency conflicts, this PR is considered an important fix for now.

What are the relevant tickets?

Have you done the following, if applicable:

(optional: add explanation between parentheses)

  • Added automated tests? ( )
  • Tested manually on mobile? ( )
  • Checked BrowserStack? ( )
  • Checked for performance implications? ( )
  • Checked accessibility? ( )
  • Checked for security implications? ( )
  • Updated the documentation/wiki? ( )

TODOs / next steps:

  • your TODO here

@SimmonsRitchie SimmonsRitchie changed the title Fix build Fix: docker failure on M1 macs Mar 5, 2022
Copy link

@bfreeds bfreeds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimmonsRitchie This worked for me (using amd64 machine). Great troubleshooting and find on a mysterious M1 issue. I'm glad that this solution allows us to still use the alpine variant, too, and agree with your assessment that it's worth keeping!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants