set the base image to Debian https://hub.docker.com//debian/ FROM debian:latest replace…
- User
set the base image to Debian
https://hub.docker.com/_/debian/
FROM debian:latest
replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
update the repository sources list
and install dependencies
RUN apt-get update
&& apt-get install -y curl
&& apt-get -y autocleannvm environment variables
ENV NVM_DIR /usr/local/nvm ENV NODE_VERSION 6.11.0
RUN apt-get update && apt-get install -y build-essential libssl-dev
python python3 gnupg2install nvm
https://github.com/creationix/nvm#install-script
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
install node and npm LTS
RUN source NVM_DIR/nvm.sh \ && nvm install NODE_VERSION
&& nvm alias default $NODE_VERSION
&& nvm use default
&& nvm install 8.1.3
&& nvm use 8.1.3add node and npm to path so the commands are available
ENV NODE_PATH NODE_VERSION/lib/node_modules ENV PATH NODE_VERSION/bin:$PATH
- Assistant
Your Dockerfile sets up a Debian-based environment with Node.js (using nvm) and Ruby installed. Here are some improvements and corrections to make it more streamlined and efficient:
- Combine
apt-getcommands: This reduces the number of layers and makes caching more efficient.
- Combine