In this article, I made a note of how to use Docker when I wanted to use it for the time being.
https://hub.docker.com/ You can create an account from this page.
input
$ docker login
Enter the created user name and password
out
Login Succeeded
input
$ docker pull {image name}
hello-For world
latest: Pulling from library/hello-world
Digest: sha256:7f0a9f93b4aa3022c3a4c147a449bf11e0941a1fd0bf4a8e6c9408b2600777c5
Status: Image is up to date for hello-world:latest
docker.io/library/hello-world:latest
input
$ docker run -it {image name}
input
$ exit
ctrl + p + q
input
$ docker ps -a
out
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c48468f185c5 ubuntu "/bin/bash" 26 hours ago Exited (255) 20 minutes ago priceless_khayyam
input
$ docker images
out
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 4e2eef94cd6b 2 weeks ago 73.9MB
input
$ docker restart {Container name}
You can confirm that STATUS is "UP ~ seconds" by pressing "docker ps -a" again.
input
$ docker exec -it {Container name}
input
$ docker commit {Container name} {New image name}
You can check it with docker images.
input
$ docker tag {Old image name:Old tag} {New image name:New tag}
input
$ docker build .
Recommended Posts