![hilscher netPI NOIT-E-NPI3-51-EN-RE User Manual Download Page 52](http://html1.mh-extra.com/html/hilscher/netpi-noit-e-npi3-51-en-re/netpi-noit-e-npi3-51-en-re_user-manual_2134824052.webp)
Isolated application execution with Docker
52/64
9.3.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/lalyos/rpi-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 49]).
Steps
Ø
On the page "Container list" click on
Add container
.
Ê
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 area
Image configuration
enter the name of
the image to be executed in the container:
lalyos/rpi-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/r/lalyos/rpi-
nginx/
.
Ø
Always set the switch
Always pull image
in the area
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.
Ê
The fields
host
and
container
are shown on the page "Container list".
Ø
Field
host
: Enter the port, e.g.
8080
, where the NGINX can be
accessed via the web browser.
Ø
Field
container
: Enter the port, e.g.
80
, that NGINX uses within the
container.
Ø
If required, set the
Advanced options
according to the documentation
of the container to be started (in this case: NGINX documentation,
https://hub.docker.com/r/lalyos/rpi-nginx/
). This example does not
require any further settings.
Ø
Click on
Start container
.
ð
The configuration of the container is thus ready for the execution of
NGINX. Docker will first load the image from the registry (duration 2-3
minutes), deposit it in the Edge Gateway, and transform it into a
container thereafter. This container will then appear in the container list
and its status changes to
running
.
netPI | NOIT-E-NPI3-51-EN-RE
DOC170801UM01EN | Revision 1 | English | 2017-09 | Released | Public
© Hilscher 2017