Skip to content

Installation of Yarn class (via NPM) on Node 17 does not work in with SDK docker image v8 #5253

@casperOne

Description

@casperOne

Describe the Bug

The following dockerfile works with mcr.microsoft.com/dotnet/sdk:6.0

# Build layer will use sdk.
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build

# Install dependencies for build:
# - NPM (need for webpack anyways)
# - yarn
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash --
RUN apt-get install -y nodejs
RUN npm install -g yarn

But when using v8

# Build layer will use sdk.
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

# Install dependencies for build:
# - NPM (need for webpack anyways)
# - yarn
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash --
RUN apt-get install -y nodejs
RUN npm install -g yarn

It fails with the message (in github actions):

Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c npm install -g yarn" did not complete successfully: exit code: 127

Steps to Reproduce

Run the following dockerfile:

# Build layer will use sdk.
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

# Install dependencies for build:
# - NPM (need for webpack anyways)
# - yarn
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash --
RUN apt-get install -y nodejs
RUN npm install -g yarn

Output of docker version

Client: Docker Engine - Community
   Version:           [24](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:25).0.9
   API version:       1.43
   Go version:        go1.20.13
   Git commit:        2936816
   Built:             Thu Feb  1 00:48:39 2024
   OS/Arch:           linux/amd64
   Context:           default
  Server: Docker Engine - Community
   Engine:
    Version:          24.0.9
    API version:      1.43 (minimum version 1.12)
    Go version:       go1.20.13
    Git commit:       fca702d
    Built:            Thu Feb  1 00:48:39 2024
    OS/Arch:          linux/amd64
    Experimental:     false
   containerd:
    Version:          1.6.28
    GitCommit:        ae07eda36dd[25](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:26)f8a1b98dfbf587[31](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:32)3b99c0190bb
   runc:
    Version:          1.1.12
    GitCommit:        v1.1.12-0-g51d5e94
   docker-init:
    Version:          0.19.0
    GitCommit:        de[40](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:41)ad0

Output of docker info

Client: Docker Engine - Community
   Version:    24.0.9
   Context:    default
   Debug Mode: false
   Plugins:
    buildx: Docker Buildx (Docker Inc.)
      Version:  v0.12.1
      Path:     /usr/libexec/docker/cli-plugins/docker-buildx
    compose: Docker Compose (Docker Inc.)
      Version:  v2.23.3
      Path:     /usr/libexec/docker/cli-plugins/docker-compose
  Server:
   Containers: 1
    Running: 1
    Paused: 0
    Stopped: 0
   Images: 16
   Server Version: 24.0.9
   Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true
    Using metacopy: false
    Native Overlay Diff: false
    userxattr: false
   Logging Driver: json-file
   Cgroup Driver: cgroupfs
   Cgroup Version: 2
   Plugins:
    Volume: local
    Network: bridge host ipvlan macvlan null overlay
    Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
   Swarm: inactive
   Runtimes: io.containerd.runc.v2 runc
   Default Runtime: runc
   Init Binary: docker-init
   containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
   runc version: v1.1.12-0-g[51](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:52)d5e94
   init version: de40ad0
   Security Options:
    apparmor
    seccomp
     Profile: builtin
    cgroupns
   Kernel Version: 6.5.0-1015-azure
   Operating System: Ubuntu 22.04.4 LTS
   OSType: linux
   Architecture: x86_64
   CPUs: 2
   Total Memory: 7.744GiB
   Name: fv-az1[52](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:53)8-436
   ID: [66](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:67)cd06a6-b2[78](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:79)-495c-ae3e-04e[92](https://github.com/casperOne/One-Frame-Link-Data/actions/runs/8219331081/job/22477168530#step:11:93)6acdc46
   Docker Root Dir: /var/lib/docker
   Debug Mode: false
   Username: githubactions
   Experimental: false
   Insecure Registries:
    127.0.0.0/8
   Live Restore Enabled: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions