Code: Select all
https://www.katacoda.com/courses/docker/playground
Code: Select all
docker search xxx
docker pull <image-name> -downloads the specified image from Docker Hub
docker image ls -lists all the downloaded images stored on your machine
docker images -lists all the downloaded images stored on your machine
docker rmi <image-name> -removes the specified image from your machine, alias for: docker image rm
docker image rm <image-name>
Code: Select all
docker ps --help
docker ps -lists all running containers
docker ps -a - list all containers (stopped also)
docker container ls -lists all running containers,
docker container ls -a -lists all containers, flag -a for all, not just running
docker stop <container-name>
docker rm <container-name>
Code: Select all
docker run -p 8080:80 -p 3000:80 <
docker run --name mysql-srv -e MYSQL_ROOT_PASSWORD=mysecretpassword-d -p 3306:3306 mysql:latest
Code: Select all
Manage images
Commands:
build Build an image from a Dockerfile
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Display detailed information on one or more images
load Load an image from a tar archive or STDIN
ls List images
prune Remove unused images
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rm Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
Run 'docker image COMMAND --help' for more information on a command.