Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
This commit is contained in:
parent
30dbc29659
commit
1bfed12966
|
@ -12,3 +12,10 @@ Your job now will be to create 2 roles:
|
|||
* one role for all tasks related to deploying nginx as a proxy
|
||||
* for this one, you must also use some variables as input parameters for both ports (80 and 8080 in the previous lessons)
|
||||
|
||||
|
||||
# Cleanup
|
||||
Once you're done, destroy the demo docker:
|
||||
|
||||
```
|
||||
docker stop demo
|
||||
```
|
||||
|
|
|
@ -53,10 +53,9 @@ docker ps
|
|||
```
|
||||
```
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
f9c03ce13b09 demo "/usr/sbin/sshd -D" 32 minutes ago Up 32 minutes 127.0.0.2:8080->8080/tcp, 127.0.0.2:2222->22/tcp demo
|
||||
```
|
||||
So you see only one container running, named `demo`.
|
||||
This is not your `debian` container, but the container used in the previous lesson.
|
||||
So you see an empty list.
|
||||
|
||||
Why the `debian` is not visible? Because it's not running anymore!
|
||||
|
||||
Q: what command can we use to retrieve all containers, including the stopped ones?
|
||||
|
@ -87,7 +86,7 @@ docker rm xxyy
|
|||
Q: which parameter to `docker run` could we pass to automate the removal of the container after the execution?
|
||||
|
||||
# Clean your environment
|
||||
Before continuing this training, destroy all running containers using `docker stop` and `docker rm`. Destroy also the `demo` container from previous lesson, we don't need it anymore.
|
||||
Before continuing this training, destroy all running containers using `docker stop` and `docker rm`.
|
||||
|
||||
# Real application
|
||||
It's now time to deploy a real application.
|
||||
|
@ -122,11 +121,9 @@ Start now a container from your image:
|
|||
```
|
||||
docker run yourname/demo-flask
|
||||
```
|
||||
This will start a container with the demo-flask, but the app will not be accessible from outside.
|
||||
This will start a container with the demo-flask, but the app will not be accessible from outside yet.
|
||||
|
||||
You remember that you installed a `nginx` proxy to access the previous `demo` container?
|
||||
|
||||
Q: find the good `docker run` command to run your container in background and expose the port locally so the `nginx` proxy reach your application.
|
||||
Q: find the good `docker run` command to run your container in background and expose the port so that you can access your app from internet.
|
||||
|
||||
Congrats, you're done with docker101!
|
||||
|
||||
|
|
|
@ -80,6 +80,6 @@ docker build -t demo .
|
|||
#systemctl restart nginx
|
||||
|
||||
title.print "Starting demo container"
|
||||
docker run -d -p 127.0.0.2:8080:8080 -p 127.0.0.2:2222:22 --name demo demo
|
||||
docker run -d --rm -p 127.0.0.2:8080:8080 -p 127.0.0.2:2222:22 --name demo demo
|
||||
|
||||
title.print "Done"
|
||||
|
|
Loading…
Reference in New Issue