Managing Containers
Estimated time to read: 2 minutes
Introduction:
Docker provides the ability to package and run an application in an isolated environment called a container. Container management is a process for automating the creation, deployment and scaling of containers.
Container management facilitates the addition, replacement and organization of containers on a large scale
-
Lets list the container if any container is running
-
Create a nginx container
- create a container and name it as ofl01
- Start the container which is created
- Create a new container using run option
-
Create a new container by supplying (-i and -t) option to get interactive terminal, by executing the below command, Note: “-i” stands for interactive & “-t” stands for terminal. So we are requesting an interactive terminal for a container.
Note: The container is created and interactive terminal is displayed. You can run commands inside the container and exit out.
-
Create a new container with detached interactive terminal (-d -i -t) option, by executing the below command. Note: d stand detached mode.
- Attach the container server03
- Run a command inside the container without attaching to the container by using exec option.
- Rename the existing container
- Pause the existing container
- Unpause the existing container
- Stop the existing container
- Start the existing container
- Restart the existing container
- Kill the container