actions / actions/runner

Docker containers: use node binary installed inside the container for running actions

Open
#2,115 2 comments 25 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Runner Feature
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

This feature request is related to:

Context

When using - for example: actions/checkout@v2 - in a workflow then it requires node to run.
The runner does attempt to provide for this and it does this by using a volume mount with target dir /__e/.
This directory contains:

  • node12/bin/node and node16/bin/node; these are 64-bit binaries linked with glibc (or at least that's what I assume, not 100% verified)
  • node12_alpine/bin/node and node16_alpine/bin/node: these are 64-bit binaries linked with musl (or at least that's what I assume, not 100% verified)

This is not always sufficient: when deploying a 32-bit(/i386) docker container then it needs a 32-bit node.
There are only 64 binaries in /__e/ and one of those is used; that does not work and results in a somewhat cryptic error.[^1]

Several solutions are possible:

  • also let the host-runner provide a 32 node binaries and adapt the code to check if a 32/64 container is used. I think #1011 is about that;
  • require node to be installed in the container; this is what this feature request is for.

Describe the enhancement

Today: when an action is run node installed in /__e/ is used, this does not always work (see above).

What I would like: make it possible to use node that is installed inside the container.
This should make it possible to install a 32-bit node inside a 32-bit container and running it - via docker - on a 64-bit host.

Code Snippet

Links to the relevant code:

Additional information

Another nice-to-have (but I suppose that could be a separate feature request): before attempting to run an action that requires node attempt to run node --version inside the container and if that fails provide an error message indicating that node is not usable.

[^1]: Error in that case: OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: no such file or directory: unknown

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Runner.Worker/Handlers/StepHost.cs around the Alpine check and NodeScriptActionHandler.cs around line 115, then trace how Docker action containers are launched. Determine how a container-installed Node binary can be selected for Node actions while preserving existing Alpine handling. Done means a 32-bit container can run its own Node binary instead of the host-mounted binary.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker, node.js
Domain
ci-cd, devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.