You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM ubuntu:latest
ARG NODE_VERSION=20
RUN apt update && apt install -y curl
# Use bash for the shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Create a script file sourced by both interactive and non-interactive bash shells
ENV BASH_ENV=/root/.bash_env
RUN touch "${BASH_ENV}"
RUN echo '. "${BASH_ENV}"' >> ~/.bashrc
# Download and install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | PROFILE="${BASH_ENV}" bash
RUN echo node > .nvmrc
RUN nvm install $NODE_VERSION && npm install --global yarn
But running the container like 'docker run --rm -it testnvm yarn -v' throws some error:
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "yarn": executable file not found in $PATH: unknown
If we start Container interactively the PATH is OK;
Hi,
we followed your guide with a slightly modification:
https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-in-docker:
But running the container like 'docker run --rm -it testnvm yarn -v' throws some error:
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "yarn": executable file not found in $PATH: unknown
If we start Container interactively the PATH is OK;
So we asked gpt for help. after several tries this Dockerfile seems to be working fine with interactive and non-interactive containers:
So I wonder if you want to update your example for a more robust nodejs-container.
Best Regards
The text was updated successfully, but these errors were encountered: