Wednesday, August 16, 2023

Running a Docker container

 

Running a Docker container 

To create and run an Nginx container named "nginx_2" using the "nginx" image with the "alpine" tag on Server, follow these steps:


1. Pull and Run Nginx Container:

   Use the following command to create and run the "nginx_2" container using the specified image and tag:

#   docker run -d --name nginx_2 nginx:alpine

  

   - `-d`: Run the container in the background (detached mode).

   - `--name nginx_2`: Assign the name "nginx_2" to the container.

   - `nginx:alpine`: Use the "nginx" image with the "alpine" tag.


2. Verify Container Status:

   To verify that the container is running, you can use the following command:

  #  docker ps

   This command will display a list of running containers, including their names, IDs, and other information. You should see the "nginx_2" container listed if it's running successfully.


That's it! You've created and run the Nginx container named "nginx_2" on Server  using the specified image and tag. 

No comments:

Post a Comment

Removing Docker container

  Removing Docker container To delete the container named "kke-container" running on Server , you can use the following steps: 1. ...