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

nodejs cannot be found when running Docker inside Docker #261

Closed
JulianGro opened this issue Dec 3, 2022 · 5 comments
Closed

nodejs cannot be found when running Docker inside Docker #261

JulianGro opened this issue Dec 3, 2022 · 5 comments
Labels
question Further information is requested

Comments

@JulianGro
Copy link
Contributor

When trying to use an action that uses nodejs (like action/checkout) inside a Docker container inside the Docker container, it fails with:

OCI runtime exec failed: exec failed: unable to start container process: exec: "/__e/node16/bin/node": stat /__e/node16/bin/node: no such file or directory: unknown

GitHubs Runners don't have a problem with finding nodejs inside a Docker container, not does the Runner container when used directly.

@myoung34
Copy link
Owner

myoung34 commented Dec 6, 2022

What is your yaml?

nodejs (like action/checkout) doesnt sound like its running in this container. Especially with /__e/node16/bin/node, thats definitely not this image.

Example:

➜  ~ docker exec -it 66b5c9b79af8 /bin/bash
root@66b5c9b79af8:/actions-runner# which node
/usr/bin/node

@myoung34 myoung34 added the question Further information is requested label Dec 6, 2022
@JulianGro
Copy link
Contributor Author

My YAML is pretty huge, so here is a shortened version that would trigger the issue:

name: Linux Server CI Build

on:
  pull_request:
    types: [opened, synchronize, reopened, labeled]
  push:
    branches:
      - master

jobs:
  build:
    name: "${{matrix.os}}, ${{matrix.arch}}"
    strategy:
      matrix:
        include:
          - os: fedora-37
            image: docker.io/overte/overte-server-build:0.1.2-fedora-37-aarch64
            arch: aarch64
            runner: linux_aarch64


      fail-fast: false

    runs-on: ${{matrix.runner}}
    container: ${{matrix.image}}

steps:
    - uses: actions/checkout@v3
      with:
        submodules: false
        fetch-depth: 1

This will run the workflow inside of a new overte-server-build:0.1.2-fedora-37-aarch64 container instead of the docker-github-actions-runner container directly.
This works fine for GitHub hosted runners, but with docker-github-actions-runner it becomes unable to find node for the actions/checkout step.

Running inside docker-github-actions-runner directly without an additional container doesn't trigger the issue.

Here is a partial explaination on what happens: actions/checkout#334 (comment)
I am not fully understanding what is going on though, and was hoping someone here ran into the same issue.

Interestingly, this only happens with v2 and v3 of the action; v1 doesn't encounter this issue.
The actions/upload-artifact behaves the same way.

Right now I am just avoiding the issue by using the v1 actions and just not doing anything those old versions cannot handle.

@nmalaguti
Copy link
Contributor

I believe this fails because docker-in-docker is not officially supported by GitHub actions. GitHub actions make some assumptions about docker networking and shared host volumes that are only true when the runner is running directly on the host, not within a docker container.

I can’t confirm without more detailed logs, but take a look at the linked issues in the README

@myoung34
Copy link
Owner

myoung34 commented Dec 8, 2022

I'm inclined to say this is something that can't be resolved here. Node is available in this runner, so it seems as though whatever container is running checkout might be hitting what @nmalaguti is pointing out

@myoung34
Copy link
Owner

Closing as stale, this cant be replicated here and the assumption is that this is a DinD issue upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants