0%

Docker examples

Set up the wordpress using Docker

First set up the enviroment

Method 1 : using docker

1
2
sudo docker run --name db --env MYSQL_ROOT_PASSWORD=example -d mariadb
sudo docker run --name MyWordPress --link db:mysql -p 8080:80 -d wordpress

Method 2 : using docker-compose

1
2
3
4
5
6
7
8
9
10
wordpress:
image: wordpress
links:
- db:mysql
port:
- 8080:80
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example

Now run

1
access http://ip:8080
处无为之事,行不言之教;作而弗始,生而弗有,为而弗恃,功成不居!

欢迎关注我的其它发布渠道