Installing linux packages inside a container. Create a file name dockerfile
and place the following commands in it.
1 2 3 4 5 6 7 8 9 10 | #Create ubuntu as base image FROM ubuntu #Install packages RUN apt-get -y update RUN apt-get -y install vim RUN apt-get -y install firefox RUN apt-get -y install software-properties-common RUN add-apt-repository ppa:deadsnakes/ppa RUN apt-get -y install python3.7 |
Build the image using the following command.
1 | sudo docker build -t username/imagename . (don’t forget the dot) |
This command builds the docker image using the dockerfile.
Run the docker image using the following command.
1 | sudo docker run -t username/imagename:tagname |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.