This time, it will be a method to connect and operate the shell of the container made with Docker Desktop for Windows with a button operation. The aim is to get used to the operation feeling of Docker Desktop for Windows before writing it in the docker file.
The version of Docker is as follows.
Let's take a look at the screen of Docker Desktop for Windows.
The getting-started command is just displayed in the black band. Since Change Hyper-V settings is set on the D drive, the behavior may be slightly different. Also, in the C drive, the powershell screen should appear on the right side, but since the getting-started operation has already been performed, it may not have appeared.
Looking at the left end, there is an item called "Container / Apps" and an item called "Images". Since "Container / Apps" is selected, try selecting "Images".
Right now there are no containers locally.
At the top there is an item called LOCAL and an item called "REMOTE REPOSITORIES".
The REMOTE REPOSITORIES side is pushed to Docker Hub, but since nothing is pushed, nothing is displayed here either.
Now, I would like to select "Container / Apps" on the far left and type the getting-started command in the black band at the command prompt.
cmd.exe
> docker run -d -p 80:80 docker/getting-started
Unable to find image 'docker/getting-started:latest' locally
latest: Pulling from docker/getting-started
cbdbe7a5bc2a: Pull complete
85434292d1cb: Pull complete
75fcb1e58684: Pull complete
2a8fe5451faf: Pull complete
42ceeab04dd4: Pull complete
bdd639f50516: Pull complete
c446f16e1123: Pull complete
Digest: sha256:79d5eae6e7b1dec2e911923e463240984dad111a620d5628a5b95e036438b2df
Status: Downloaded newer image for docker/getting-started:latest
42f186b5894caa251bce39742538520666187ae9e27bb5a01855538c2f992d5c
At first, the following screen may appear. Press "Allow access".
You've done docker pull and docker run on port 80.
Let's take a look at the Docker Desktop screen. The container added to "Containers / Apps" is displayed.
If you move the cursor to the right side, the icons are lined up. I would like to move the cursor to each icon. Pressing "OPEN IN BROWSER" will take you to the web page for this container that is currently docker running.
If you press "CLI", you can connect to the shell of this container that is currently docker running. Linux commands are working. You can check what command is used to connect to the container by checking the upper part of the opened screen. You can stop this container by pressing "STOP". Press "RESTART" to restart this container. You can delete this container locally by pressing DELETE. I have checked the "Containers / Apps" side.
I would like to check the screen on the "Images" side. The image of the container that was just started is displayed. The display "IN USE" seems to be displayed for containers that have been started even once.
There is an icon called "RUN" on the right side. This will be the button to launch the container from the image you are currently viewing.
(There is another button next to "RUN", but I'd like to write an article if I have another chance.)
When you press the button, another getting-started container will be created and started. When you press the "RUN" button, the screen "New Container" is displayed. It seems that you can also click "Opthonal Settings" to set each. docker pull Now I want to docker pull the CentOS container.
cmd.exe
> docker pull centos:latest
latest: Pulling from library/centos
3c72a8ed6814: Pull complete
Digest: sha256:76d24f3ba3317fa945743bb3746fbaf3a0b752f10b10376960de01da70685fbd
Status: Downloaded newer image for centos:latest
docker.io/library/centos:latest
It doesn't seem to appear in "Containers / Apps" because just docker pull brought the image locally. Check the "Images" screen. The image of the docker container of CentOS that has been docker pulled is displayed. Move the cursor to the right and press the "RUN" button. Since "New Container" is displayed, you can start the container by pressing the "RUN" button.
Recommended Posts