When docker build, the RUN command can be run in the environment variable in the FROM image.

background

  • I created a container using the ubuntu14.04 image
  • installed my runtime environment in the container and installed a lot of libraries. Such as nvm node and other compiled libraries
  • I commit the container where I installed the tool library into an image
  • I created a dockerfile FROM to fill in the image of my commit just now

question: when running RUN node-v, prompt / bin/sh: 1: node: not found
my image is already installed. How to make the RUN command in dockerfile run in the environment variable of my commit image during build

Jan.08,2022

write the absolute path after

RUN
such as

RUN /usr/bin/node -v 
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7acbfc-28f00.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7acbfc-28f00.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?