-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[ERROR] npm unavailable after installing on python:3.11-slim-bookworm docker image #1790
Comments
Hi @SamStephens. FROM python:3.11-slim-bookworm
RUN apt-get update -y && apt-get install curl -y
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
RUN node -v
RUN npm -v |
Oh okay, that's embarrassing, apologies for the mistake. I was confused here because
Has an exit code of 0, hence Dockerfile execution continues, whereas
Has an exit code of 127. I wonder if there's an alternative way to formulate a command to download and run https://deb.nodesource.com/setup_20.x that will fail if curl is not present? Especially as this behavior will mask other errors, such as transient 5xx failures, meaning |
Hi @SamStephens that's why we have the following in the README.
The |
@riosje unfortunately the formulation with the As I said above, This is why I formulated things as I did. From a Dockerfile perspective
is functionally equivalent to
with execution being halted before You can see this empirically with the Dockerfile
Which is subject to the same issue as my original reproduction. |
Describe your bug
When I try and install using the setup script against the base Docker image
python:3.11-slim-bookworm
,npm
is not available.The failure looks similar to #1770, however I'm using the setup script as that issue says I should. I've tried using the pinning workaround detailed in that issue, and it doesn't help.
The issue appears to be with using the slimmed down base image, using
python:3.11-bookworm
as the image does work. However if the failure is because the slimmed down base image doesn't include required dependencies, I'd expect the setup script to fail, not succeed withoutnpm
available,.Distribution Information:
Node Version:
To Reproduce
This Dockerfile will fail with the error
npm: not found
.As will this one with the pinning fix.
This Dockerfile will succeed - the only difference to the original failure Dockerfile is we're not using the slim version of the base image:
Expected behavior
Either the setup script should have succeeded, and npm be available, or the setup script should have failed (probably complaining about missing build dependencies due to the usage of the slim base image).
Screenshots
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: