First, build the created container image and start the container image. The directory where docker-compose ~ can be executed is the location of docker-compose.yml (Composefile).
Terminal(Build and launch container image)
$ docker-compose build
$ docker-compose up -d
(Can be omitted like the command below)
$ docker-compose up -d --build
Enter.
After booting the image, use the ps command to check the boot status of the image. (You don't have to worry about "The specified path cannot be found.")
$ docker-compose ps
The specified path can not be found.
Name Command State Ports
------------------------------------------------------------------------
nginx nginx -g daemon off; Up 0.0.0.0:80->80/tcp
php-fpm docker-php-entrypoint php-fpm Up 0.0.0.0:9000->9000/tcp
You can see that the images named "nginx" and "php-fpm" are running in the Name column. If the State is "Up", it is running. If it says "Exit", it is stopped.
Then, the login command of the main subject is as follows.
$ docker exec -it nginx /bin/sh
/ #
To log out, just execute the exit command. that's all.
Recommended Posts