Changes

Docker

1,891 bytes added, 22:19, 23 June 2018
How to use docker-compose
MYSQL_ROOT_PASSWORD: example
</syntaxhighlight>
 
 
 
<pre>
[wp-example]# docker-compose up -d
Building wordpress
Step 1/5 : FROM wordpress:latest
---> 7801d36d734c
Step 2/5 : COPY ./example.html /var/www/html/example.html
---> ab67aee3c270
Removing intermediate container a0894a2e834f
Step 3/5 : VOLUME /var/www/html
---> Running in 470025d9c877
---> 9890d3cd9f0a
Removing intermediate container 470025d9c877
Step 4/5 : ENTRYPOINT docker-entrypoint.sh
---> Running in 09548484b9b2
---> 555754d6a3a7
Removing intermediate container 09548484b9b2
Step 5/5 : CMD apache2-foreground
---> Running in 035fcfc0876d
---> 076e75c72b58
Removing intermediate container 035fcfc0876d
Successfully built 076e75c72b58
Successfully tagged wp2-example_wordpress:latest
WARNING: Image for service wordpress was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating wp2-example_db_1 ... done
Creating wp2-example_wordpress_1 ... done
Attaching to wp2-example_db_1, wp2-example_wordpress_1
</pre>
 
 
<pre>
[wp-example]# docker-compose ps
Name Command State Ports
---------------------------------------------------------------------------------------
wp2-example_db_1 docker-entrypoint.sh mysqld Up 3306/tcp
wp2-example_wordpress_1 docker-entrypoint.sh apach ... Up 0.0.0.0:8080->80/tcp
</pre>
 
 
<pre>
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8ec2920234b6 wp2-example_wordpress "docker-entrypoint..." About a minute ago Up About a minute 0.0.0.0:8080->80/tcp wp2-example_wordpress_1
786fb7da1ca7 mariadb "docker-entrypoint..." About a minute ago Up About a minute 3306/tcp wp2-example_db_1
</pre>
=SWARM=