-
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
Description
Hello, I am attempting to slim an image using the command ./mint build --http-probe=false [IMAGE_ID]. This image was built from a Dockerfile with an entry point set to CMD ["npm", "test"]. However, when running the slimmed container, I encounter a "Node.js not found" error.
Here is the Dockerfile.
FROM node:current
RUN npm config set registry https://registry.npmmirror.com \
&& mkdir -p /opt/target-project \
&& mkdir -p /opt/npm_pkgs/node_cache \
&& mkdir -p /opt/npm_pkgs/node_global \
&& mkdir -p /opt/npm_pkgs/node_modules
COPY ./target-project /opt/target-project
WORKDIR /opt/target-project
RUN npm config set prefix "/opt/npm_pkgs/node_global" \
&& npm config set cache "/opt/npm_pkgs/node_cache" \
&& echo 'export PATH=/opt/npm_pkgs/node_global/bin:$PATH' >> ~/.profile \
&& echo 'export PATH=/opt/npm_pkgs/node_cache/bin:$PATH' >> ~/.profile \
&& /bin/bash -c "source ~/.profile" \
&& chmod -R 777 /opt \
&& npm install
CMD ["npm", "test"]