Home > Article > CMS Tutorial > How to install WordPress in docker environment
Install WordPress in docker environment:
1. Install docker environment first
Open the command line, copy and execute.
Execute Command:
docker run --name db --env MYSQL_ROOT_PASSWORD=example -d mariadb
The code during execution is as follows:
$ docker run --name db --env MYSQL_ROOT_PASSWORD=example -d mariadb Unable to find image 'mariadb:latest' locally latest: Pulling from library/mariadb cd0a524342ef: Pull complete d9c95f06c17e: Pull complete 46b2d578f59a: Pull complete 10fbc2bcc6e9: Pull complete c5b600f068c4: Pull complete 4bca4fbb56d8: Pull complete b9e6f929873a: Pull complete d6a107bfa79e: Pull complete 535efcd897c3: Pull complete 73201af09173: Pull complete cfe3cdae1993: Pull complete 69f22759c937: Pull complete Digest: sha256:7cf3822d4582d5d0d95c2512ea6b5d2d4bdb4b299ce7ed67cb5c84df081cf14c Status: Downloaded newer image for mariadb:latest 3ccdd915760f9935505f997e7820501f497f17570cb23a2e4d33f8325c84603b
Explain the above code:
Use the docker command to create a mariadb database. And specify the password.
2. Start installing WordPress and execute the following command:
docker run --name MyWordPress --link db:mysql -p 8080:80 -d wordpress
The execution process is:
$ docker run --name MyWordPress --link db:mysql -p 8080:80 -d wordpress Unable to find image 'wordpress:latest' locally latest: Pulling from library/wordpress cd0a524342ef: Already exists 14b8a88a0af0: Pull complete d78c922dd678: Pull complete 6680e61553d3: Pull complete df1ddb74fbec: Pull complete 048af0e09526: Pull complete d11ab6756039: Pull complete 8b684f7dda23: Pull complete 206854c69eb7: Pull complete b7e643dc9b09: Pull complete b9503d4d2386: Pull complete f31ae3e5fa86: Pull complete 44fd64f7b16f: Pull complete 0b10d49f9584: Pull complete a59a3f4f432b: Pull complete d5fad60b1fb1: Pull complete 6762d0157c35: Pull complete 08dc92905b0e: Pull complete Digest: sha256:dc77678ddced9623331e051e1b192ee76f887fd683b9ede2f718a6bc4eb08ea6 Status: Downloaded newer image for wordpress:latest e50397d0b22acb3e3d14a0cdcd7ae048d61870c195934c2d6172e8f5b2cf3a74
The downloading process may be a little slow. Wait patiently for the download to complete. Wait for the download to complete. , WordPress is installed.
You can use docker-machine ip to view the ip. Then, use a browser to open the corresponding ip address, and you can access it directly. My ip here is: 192.168.1.100
Use this address
http://192.168.99.100:8080/wp-admin/install.php to directly access the background installation program. Install WordPress.
Installation process :
1. Select the language as Simplified Chinese:
Fill in the main information. Click to install WordPress
Remember the password for the next login, or you can change it to the password you want to set: my default password is: JO*bYhC#1#XESUNVj8, if you have not reset the password, Please remember your randomly generated password.
The installation is complete, click to log in. The login information here is the username and password you just set.
For more wordpress related technical articles, please visit the wordpress tutorial column to learn!
The above is the detailed content of How to install WordPress in docker environment. For more information, please follow other related articles on the PHP Chinese website!