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

Adding linux/arm64 platform to docker build-push-action #91

Merged
merged 4 commits into from
Mar 6, 2024
Merged

Adding linux/arm64 platform to docker build-push-action #91

merged 4 commits into from
Mar 6, 2024

Conversation

ChrisCarini
Copy link
Contributor

Summary

Adding linux/arm64 platform to docker build-push-action

Also merged in the changes from #55 (CC: @Lissy93 )

Additional Resources / Context

Turns out building a arm64 image for yarn projects on GitHub runners is less-easy than one might suspect. Specifically...

Issue: yarn install timeouts

I encountered timeout issues pulling yarn dependencies, ultimately due to the emulation from QEMU. This can be worked around via extending the timeout to something long.

Solution: Adding --frozen-lockfile --network-timeout 100000 in the Dockerfile

Issue: missing python

I also encountered issues that python was missing from the path. A quick internet search showed that having apt install this would likely resolve the issue.

Solution: Adding python make g++ in the Dockerfile (and, also merging in the changes from #55 )

Resources

Below are some links/resources I found that helped me address these issues:

Details / Testing

I forked this repo to my own -> https://github.com/ChrisCarini/web-check (I may only keep this fork around for the life of this PR), changed .github/workflows/docker.yml#18 to be my DOCKER_USER then ran the workflow.

Before

Before the change in this PR, the workflow succeeded, publishing an image with the single expected os/arch (linux/amd64):

Screenshot 2024-02-28 at 20 36 14

After

I incorporated the change in this PR, and re-ran the workflow, which succeeded. As you can see below, the image was published with the two expected os/arch (linux/amd64 and linux/arm64):

Screenshot 2024-02-29 at 08 38 05

Bug(s)

Fixes #73

Lissy93 and others added 4 commits September 14, 2023 20:59
Updates the Dockerfile with changes suggested by @GWnbsp  in #43 (comment)

### Summary of Changes
1. **ARG Statements:** Introduced `ARG` statements for Node.js and Debian versions, making the Dockerfile more customizable.
2. **SHELL Command:** Changed the default shell to Bash with certain options enabled, improving robustness.
3. **Chromium Installation:** Updated Chromium installation to use Google's signing keys and repositories, aiming for more secure and up-to-date packages.
4. **Chromium Version:** Added a step to save Chromium's version into `/etc/chromium-version` for reference.
5. **Directory Creation:** Added a new directory /app/data in the container's filesystem.
6. **CMD Change:** Changed the CMD to start Node.js server (server.js) instead of using yarn serve.
7. **General Cleanup and Comments:** Code has been refactored for better readability and detailed comments have been added for clarity.
8. **Dependency Installation:** Kept yarn install and the removal of the Yarn cache, but the command is more streamlined.
9. **Other Minor Changes:**
  - Added flags like `-qq` and `--no-install-recommends` for quieter and optimized installation.
  - Enhanced cleanup with `rm -rf /var/lib/apt/lists/*.`
Copy link

netlify bot commented Feb 29, 2024

Deploy Preview for web-check ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 761f9da
🔍 Latest deploy log https://app.netlify.com/sites/web-check/deploys/65e0b35d893cc100088ad603
😎 Deploy Preview https://deploy-preview-91--web-check.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

This was referenced Feb 29, 2024
@Lissy93 Lissy93 merged commit 195577f into Lissy93:master Mar 6, 2024
4 of 5 checks passed
@ChrisCarini ChrisCarini deleted the patch-1 branch March 10, 2024 15:06
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.

Building Docker Images for ARM64
2 participants