Isolated application execution with Docker
222/263
Functions for working with containers
Docker provides the following functions for controlling the code execution:
Icon
Function
Meaning
Start
Starting a container
Stop
Stopping a container
Kill
Aborting the execution of a container
Restart
Repeated starting of a container
Pause
Interrupting the execution of a container temporarily
Resume
Continuing the execution of a container after an interruption
Remove
Deleting a container
Table 73: Functions for working with containers
15.2.2
Example: Executing the web server NGINX as a container
NGINX is an open-source web server. This section shows how to execute
the web server NGINX with Docker on the Edge Gateway.
Note:
Further information on the web server NGINX can be downloaded
from
https://nginx.org/
,
https://hub.docker.com/r/_/nginx/
, and
https://en.wikipedia.org/wiki/Nginx
.
Prerequisite
The following prerequisite must be met: The user interface portainer.io is
open (see
The portainer.io interface
[
}
page 220]).
Steps
Ø
On the page "Container list" click
.
Ê
The page "Create container" will be displayed.
Ø
In the field
Name
enter the name of your container, e.g.
MyFirstContainer
.
Ø
In the field
Image
of the zone
Image configuration
enter the name of
the image to be executed in the container:
nginx.
Ê
The system will automatically search for the image in the official Docker
registry, and the NGINX repository (located there) will load it. The http-
address of the NGINX repository is
https://hub.docker.com/_/nginx/
.
Ø
Always set the switch
Always pull image
of the zone
Image
configuration
to
On
(i.e. the switch is in position "right"). This
automatically loads the image before the start. A manual loading via the
option "Images" from portainer.io is thus no longer required.
Ø
To configure a network-port-assignment between container and Linux-
host-system, click the button
map additional port
. This will deviate
network port
80
, used by NGINX as standard, e.g. to port
8080
and
make it accessible for the web browser.
Edge Gateway | NIOT-E-TIB100-GB-RE (Remote)
DOC170501UM04EN | Revision 4 | English | 2018-08 | Released | Public
© Hilscher 2017 – 2018