containers icon indicating copy to clipboard operation
containers copied to clipboard

Fedora35 container Dockerfile, build fails because of Node version. Update needed for package resolution.

Open el-tipton opened this issue 2 years ago • 4 comments

Describe the bug When attempting to build the base target 'build' for the Fedoracore35 image, the following was error was observed:

#4 [build 1/6] FROM registry.fedoraproject.org/fedora-minimal:35@sha256:a0ac5d212f0fca2ddb55078b6f3bb31a92e5dc944ba8f4e37e322f38f01bff2d
#4 DONE 0.0s

#5 [build 2/6] RUN dnf       --assumeyes       --nodocs       --setopt=install_weak_deps=0       install         acpica-tools         dotnet-runtime-6.0         gcc-c++-11.2.1-1.fc35         gcc-11.2.1-1.fc35         gcc-aarch64-linux-gnu-11.2.1-1.fc35         gcc-arm-linux-gnu-11.2.1-1.fc35         gcc-riscv64-linux-gnu-11.2.1-1.fc35         git         lcov         libX11-devel         libXext-devel         libuuid-devel         make         nuget         nasm-2.15.05-1.fc35         https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell-7.3.1-1.rh.x86_64.rpm         python3.10         python3-distutils-extra         python3-pip         python3-setuptools         nodejs         npm         tar         sudo
#5 CACHED

#6 [build 3/6] RUN alternatives --install /usr/bin/python python /usr/bin/python3 1
#6 CACHED

#7 [build 4/6] RUN pip install pip lcov_cobertura --upgrade
#7 CACHED

#8 [build 5/6] RUN mkdir -p /cross-tools/ &&       curl -L "https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-6.3-cross-tools-c-only.tar.xz" |       tar --extract -z --strip-components=1 -C /cross-tools
#8 CACHED

#9 [internal] load build context
#9 transferring context: 309.81kB 0.0s done
#9 DONE 0.0s

#10 [build 6/6] RUN npm install -g npm       [email protected]       [email protected]
#10 1.595 npm ERR! code EBADENGINE
#10 1.596 npm ERR! engine Unsupported engine
#10 1.596 npm ERR! engine Not compatible with your version of node/npm: [email protected]
#10 1.596 npm ERR! notsup Not compatible with your version of node/npm: [email protected]
#10 1.596 npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"}
#10 1.596 npm ERR! notsup Actual:   {"npm":"8.19.2","node":"v16.18.1"}
#10 1.598
#10 1.598 npm ERR! A complete log of this run can be found in:
#10 1.598 npm ERR!     /root/.npm/_logs/2023-09-05T13_39_03_278Z-debug-0.log
#10 ERROR: process "/bin/sh -c npm install -g npm       cspell@${CSPELL_VERSION}       markdownlint-cli@${MARKDOWNLINT_VERSION}" did not complete successfully: exit code: 1

To Reproduce To reproduce the issues, attempt a build for the Fedora35 image Dockerfile (https://github.com/tianocore/containers/blob/5b8a008fb8bbcc2ff1dc3874a29eaf2120a47104/Fedora-35/Dockerfile). E.g. 'docker build -f Dockerfile --target build '. An error similar to that included should be observed when the checks on npm and node versioning fails. Here the issue is that Node will be at version 16.18.1.

Expected behavior The expected behavior is that the 'npm' installation of packages should complete as expected and the 'build' target for the Fedora35 Dockerfile should successfully complete when building a container.

Execution environment The issue was observed on an Ubuntu 22.04.3 LTS system, with Docker version 24.0.5, build ced0996.

Additional context Add any other context about the problem here.

el-tipton avatar Sep 05 '23 19:09 el-tipton

hi @el-tipton, thanks for reporting this issue. I suspect the Fedora 35 file is just old, and versions have moved on. I'll take a look.

You could try the Fedora 37 images instead.

osteffenrh avatar Sep 06 '23 08:09 osteffenrh

Thank you @osteffenrh for taking a look. Agreed, age/version creep is inevitable. Likewise, it is great you all have additional options/containers to track.

el-tipton avatar Sep 06 '23 11:09 el-tipton

Installing 'n' for the npm package manager, then upgrading node to the 'lts' release (currently tracking 18.x release) appears to resolve the issue. E.g. "RUN npm install -g n && n lts" just before attempting to install cspell, markdownlint, etc.

el-tipton avatar Sep 06 '23 11:09 el-tipton

@el-tipton, thanks for the info. If you are interested in using the f35 image, would you mind opening a PR with the fix? But I recommend trying the f37 image and to use that instead.

@cfernald, do we still have any need for the f35 image? Shall we deprecate it (or just simply remove it)?

osteffenrh avatar Sep 07 '23 08:09 osteffenrh

The Fedora 35 container was removed since it's EOL, so closing this issue.

ghost avatar May 24 '24 11:05 ghost