Creating Dockerfiles
Dockerfiles contain all commands that you call on a command line to assemble a docker image.
Context
Procedure
Next Steps
RUN groupadd -g 1972 vflow && useradd -g 1972 -u 1972 -m vflow USER 1972:1972 WORKDIR /home/vflow ENV HOME=/home/vflow
Make sure that the commands you run after the USER directive operate with the new environment. Therefore, consider the following situations:
-
If you install new Python packages with pip, ensure that you have the --user flag for local installations.
-
If you install software without using the package manager, or you install software that doesn't support local installation, then you must install the software manually inside the user home directory, such as /home/vflow. Do the same for any other files added to the image.