You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To spawn a new instance of wordpress on port 80. The -p 80:80 maps the internal docker port 80 to the outside port 80 of the host machien.
20
20
21
21
```bash
22
-
$ sudo docker run -p 80 -d docker-wordpress-nginx
22
+
$ sudo docker run -p 80:80 --name docker-wordpress-nginx -d docker-wordpress-nginx
23
23
```
24
24
25
-
You'll see an ID output like:
25
+
Start your newly created docker
26
+
26
27
```
27
-
d404cc2fa27b
28
+
$ sudo docker start docker-wordpress-nginx
28
29
```
29
30
30
-
Use this ID to check the port it's on:
31
-
```bash
32
-
$ sudo docker port d404cc2fa27b 80 # Make sure to change the ID to yours!
31
+
After starting the docker-wordpress-nginx check to see if it started and the port mapping is correct. This will also report the port mapping between the docker container and the host machine.
33
32
```
33
+
$ sudo docker ps
34
34
35
-
This command returns the container ID, which you can use to find the external port you can use to access Wordpress from your host machine:
36
-
37
-
```
38
-
$ docker port <container-id> 80
35
+
0.0.0.0:80 -> 80/tcp docker-wordpress-nginx
39
36
```
40
37
41
38
You can the visit the following URL in a browser on your host machine to get started:
0 commit comments