docker login
$docker login -u {username}
docker run
2-1) hello-world가 없는데 docker run hello-world
bash: docekr: command not found
2-2) hello-world가 없을 때 실행
docker run --name hello-world hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:6e8b6f026e0b9c419ea0fd02d3905dd0952ad1feea67543f525c73a0a790fefb
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
docker pull
$docker pull datawhales/fastapi-image:0.1.2
(Image이름:버전)
docker images
$docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
fastapi v1 f9e231e056b3 6 weeks ago 938MB
mysql 8 7484689f290f 3 months ago 538MB
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b02a9fcc07c hello-world "/hello" 4 minutes ago Exited (0) 4 minutes ago hello-world
bfa3341642d7 mysql:8 "docker-entrypoint.s…" 2 months ago Exited (255) 6 weeks ago 3306/tcp, 33060/tcp, 0.0.0.0:3307->3307/tcp mysql-tutorial
docker rm
6-1) containers 삭제시
docker rm
6-2) Image삭제시
docker rmi