May 24, 2017

Docker: Troubleshoot This

Troubleshoot This

  1. Describe the command sequences below and explain the error message.
  2. How would you fix it?



Creative Commons License Licensed under a Creative Commons Attribution 4.0 International License.

Docker Commands: docker search

Docker Commands: docker search


docker search <ImageName>

Looks like command line version of a Docker Hub search


Note:
NAME is the image name.
Names in the format <UserID>/<ImageName> represent images uploaded by non-official sources.
STARS represent the number of likes for a specific image.
OFFICIAL identifies official vendor images.

Creative Commons License Licensed under a Creative Commons Attribution 4.0 International License.

Docker Commands: docker attach

Docker Commands: docker attach


docker attach <container>

Attach to a running container.

First make sure the container is running. If its stopped, start it, then attach to it.


Creative Commons License Licensed under a Creative Commons Attribution 4.0 International License.

Docker Commands: docker ps

Docker Commands: docker ps


docker ps -a

List all containers (running or not).

docker ps lists only the running containers.


Creative Commons License Licensed under a Creative Commons Attribution 4.0 International License.

Docker Commands: docker rmi

Docker Commands: docker rmi


docker rmi <image ID>

Remove one (or more) images




Note: You can identify the image(s) to remove using REPOSITORY instead of the IMAGE ID.

Creative Commons License Licensed under a Creative Commons Attribution 4.0 International License.

Docker Commands: docker rm

Docker Commands: docker rm


docker rm <container ID>

Remove one (or more) containers



Note: You can identify the container(s) to remove using either CONTAINER ID or NAMES:


Creative Commons License Licensed under a Creative Commons Attribution 4.0 International License.