Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
[docker@sprint1-docker-vm ~]$ docker run -d --name mysql -v mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=wordpress -e MYSQL_DATABASE=wordpress -e MYSQL_USER=wordpress -e MYSQL_PASSWORD=wordpress mysql:5.7
Unable to find image 'mysql:5.7' locally
5.7: Pulling from library/mysql
6ae821421a7d: Pull complete
a9e976e3aa6d: Pull complete
e3735e44a020: Pull complete
bfd564e9483f: Pull complete
df705f26e488: Pull complete
0c5547f73d62: Pull complete
f437382cf8a1: Pull complete
4f22805bb6d6: Pull complete
394f0f652697: Pull complete
fb068b9b9d1f: Pull complete
fdfc96ad0937: Pull complete
Digest: sha256:8c15b2612051244d0a2b6ceb6f9bf82ddc0e909555c1067c098e5f935e2751a7
Status: Downloaded newer image for mysql:5.7
5904e0153ef20fe20909f7732419c862251c9fbb4a2ff533c858c46d73039ba5
[docker@sprint1-docker-vm ~]$
[docker@sprint1-docker-vm ~]$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                 NAMES
5904e0153ef2        mysql:5.7           "docker-entrypoint.s..."   10 seconds ago      Up 8 seconds        3306/tcp, 33060/tcp   mysql
[docker@sprint1-docker-vm ~]$

WordPress Container 실행

Code Block
[docker@sprint1-docker-vm ~]$ docker run -d --name wordpress -v wordpress:/var/www/html --link mysql:mysql -e WORDPRESS_DB_HOST=mysql:3306 -e WORDPRESS_DB_PASSWORD=wordpress -p 80:80 wordpress:latest
Unable to find image 'wordpress:latest' locally
latest: Pulling from library/wordpress
6ae821421a7d: Already exists
08f3d19635b0: Pull complete
dc8a54b8000b: Pull complete
b2c1d103db99: Pull complete
edfa752aa38a: Pull complete
583d37cbf2f0: Pull complete
c7846a240c1d: Pull complete
d8f9f0fd02fe: Pull complete
01d43e56770d: Pull complete
d7028d09ed0d: Pull complete
e7ada57130df: Pull complete
f8e18fc0e759: Pull complete
84b31f19dee2: Pull complete
5c0a2578817b: Pull complete
2fc1807539b8: Pull complete
62fcf2f6ca7b: Pull complete
64fda3ba2679: Pull complete
7500be78bfbe: Pull complete
Digest: sha256:37f9b9ba391302990b349daefe9fbf4691f79d4aa87e1af5f3617a3750e9678c
Status: Downloaded newer image for wordpress:latest
d98ae9cd7f0fac2278dca59c03b82e673a2ee20e7da081ad2fed0e3a15335b69
[docker@sprint1-docker-vm ~]$
[docker@sprint1-docker-vm ~]$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                 NAMES
d98ae9cd7f0f        wordpress:latest    "docker-entrypoint.s..."   39 seconds ago      Up 37 seconds       0.0.0.0:80->80/tcp    wordpress
5904e0153ef2        mysql:5.7           "docker-entrypoint.s..."   3 minutes ago       Up 3 minutes        3306/tcp, 33060/tcp   mysql
[docker@sprint1-docker-vm ~]$