3/18/2024 0 Comments Docker remove container on exit![]() ![]() In order to view if the new image has been successfully created just run docker images command and a listing of all saved images will be shown. Here, 5976e4ae287c represents the container ID and ubuntu-nginx represents the name of the new image that has been saved with committed changes. # docker ps -lĪnd apply changes by running the below command: # docker commit 5976e4ae287c ubuntu-nginx Next, after Nginx package is installed, issue the command docker ps -l to get the ID or name of the running container. If you get error ‘ E: Unable to locate package nginx‘, then you need to connect to a container with interactive CLI and install nginx as shown. # docker run ubuntu bash -c "apt-get -y install nginx" But before committing any changes to a container, first start the container with the below commands which updates and installs Nginx daemon into Ubuntu image: # docker run ubuntu bash -c "apt-get -y update" In this example, we will run and save an Ubuntu-based Docker container where the Nginx server will be installed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |