Install yum on docker container12/19/2023 ![]() ![]() 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. How to Install Docker and Run Containers in CentOS/RHEL 8/7 – Part 1ġ.Following the previous Docker article, this tutorial will discuss how to save a Docker container into a new image, remove a container, and run an Nginx web server inside a container. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |