What is docker?
Install Docker on Mac (Update: 2019/7/13)
docker version
Double-click Docker.dmg to start the install process. When the installation completes and Docker starts, the whale in the top status bar shows that Docker is running, and accessible from a terminal.
git version
docker is container management software. I installed it, so let's use it.
cmd
docker run -d -p 80:80 --name {Container name} nginx
cmd
docker container stop {Container name}
cmd
docker container start {Container name}
cmd
docker container ls
cmd
docker container ls -a
cmd
docker container rm {Container name}
cmd
docker image rm {ID}
――What is nginx? --What is an image?
[Introduction] What is Nginx (Engine X)? Differences from Apache and initial settings Tutorial aimed at understanding Docker images
Suitable for static content. Apache is suitable for dynamic content such as video processing.
A Docker image is made up of multiple image layers that have a parent-child relationship. The image layer is read-only. Docker uses technology that integrates file and directory information from multiple image layers into one.
The Docker container is the execution part of the virtual environment created based on the Docker image.
Building PHP 7.0 x Apache environment with Docker
Use Apache instead of nginx! The business is Apache.
cmd
docker run -d -p 80:80 --name php70-apache php:7.0-apache
cmd
docker container exec -ti php70-apache bash
cmd
echo '<?php phpinfo();' > index.php
First, delete the container you created earlier.
cmd
#Stop container
docker container stop php70-apache
#Delete container
docker container rm php70-apache
cmd
docker run -d -p 80:80 -v /Users/[user name]/docker/php70-apache/www:/var/www/html --name php70-apache php:7.0-apache
cmd
docker container exec -ti php70-apache bash
cmd
echo '<?php phpinfo();' > index.php
Recommended Posts