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

Docker build hangs for linux/arm/v7 #1071

Closed
3 tasks done
Lissy93 opened this issue Mar 4, 2024 · 1 comment
Closed
3 tasks done

Docker build hangs for linux/arm/v7 #1071

Lissy93 opened this issue Mar 4, 2024 · 1 comment

Comments

@Lissy93
Copy link

Lissy93 commented Mar 4, 2024

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

Feel free to close this ticket if you don't think it's an issue with this action. But any pointers would also be much appreciated, I've been going round in circles for hours trying to get it to work.

I have the following workflow file which builds this Dockerfile, and it always used to work great.

But now it only works for linux/amd64 and linux/arm64 architectures, as soon as I add linux/arm/v7 back in under platforms, the workflow just hangs forever midway through the ARM v7 step (specifically during yarn install) - here's an example run

Expected behaviour

I expect linux/arm/v7 to complete successfully, like it does for linux/amd64 and linux/arm64

Actual behaviour

The workflow just hangs indefinabley once it starts the yarn install on the linux/arm/v7 step.

Repository URL

https://github.com/Lissy93/dashy

Workflow run URL

https://github.com/Lissy93/dashy/actions/workflows/docker-build-publish.yml

YAML workflow

Full workflow file here:
https://github.com/Lissy93/dashy/blob/HEAD/.github/workflows/docker-build-publish.yml

The relevant step is:

- name: ⚒️ Build and push
  uses: docker/build-push-action@v2
  with:
    context: .
    file: ./Dockerfile
    platforms: linux/amd64,linux/arm64,linux/arm/v7
    tags: ${{ steps.meta.outputs.tags }}
    labels: ${{ steps.meta.outputs.labels }}
    push: true

Workflow logs

logs_21336268151.zip or on GitHub at: https://github.com/Lissy93/dashy/actions/runs/8133127098/job/22224327445

Another example: here

BuildKit logs

No response

Additional info

Thank you for building and maintaining this action, it's been super useful 💙

@Lissy93
Copy link
Author

Lissy93 commented Mar 4, 2024

Ah, I found a workaround.

For anyone who faces something similar, issue is something to do with the newer Node containers (V18 upwards).

I believe it happens because the x86 host is building for a non-native platform, and QEMU emulation is very intensive, crashing the GitHub worker, but weirdly never exiting (I'd expect a ENOMEM failure).

Relevant issues:

Example fix, in my project: Lissy93/dashy#1492

It's frustrating, because performance and security of Node 20+ is much better. But since this issue only happens during npm install / yarn install, it's possible to use Node 18 for the build stage, then Node 21 for the run stage (feels weird, but works well).

# Build stage
- FROM node:20.11.1-alpine AS BUILD_IMAGE
+ FROM node:18.19.1-alpine AS BUILD_IMAGE
...

# Run stage
FROM node:20.11.1-alpine3.19
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant