Manage Containers

<< Click to Display Table of Contents >>

Raynet One Technology Catalog > 14.0 > Installation Guide > Appendix A. Basic Docker Commands 

Manage Containers

Show a list of running containers

docker ps

 

Start a list of all containers

docker ps -a

 

Delete a container

docker rm CONTAINER

Example:

docker rm catalog

 

Delete a running container

docker rm -f CONTAINER

Example:

docker run -f catalog

 

Delete stopped containers

docker container prune

 

Stop a running container

docker stop CONTAINER

Example:

docker stop catalog

 

Start a stopped container

docker start CONTAINER

Example:

docker start catalog

 

Copy a file from a container to the host

docker cp CONTAINER:SOURCE TARGET

Example:

docker cp catalog:/index.html index.html

 

Copy a file from the host to a container

docker cp TARGET CONTAINER:SOURCE

Example:

docker cp index.html catalog:/index.html

 

Start a shell inside a running container

docker exec -it CONTAINER EXECUTABLE

Example:

docker exec -it catalog bash

 

Rename a container

docker rename OLD_NAME NEW_NAME

Example:

docker rename datacollection catalog

 

Create an image out of the container

docker commit CONTAINER

Example:

docker commit catalog