Starting and Managing Containers with Portainer
Overview
Portainer is a lightweight management UI that allows you to easily manage your different Docker environments.
Torizon comes with Portainer pre-loaded and it automatically starts after the module boot-up.
In this module you will:
- Learn how to access Portainer through a web browser
- Learn how to start a container execution using Portainer
Typographic Conventions
Throughout the Toradex documentation, the following typographic conventions are used:
$ (dollar sign) Command in the host computer (e.g. your PC)
$ Command in your PC
$$ (double dollar sign) Command in a container in the host computer (e.g. your PC)
$$ Command inside a container in your PC
# (hashtag) Command in the target device/board (e.g. Linux terminal)
# Command in the target board, e.g. Colibri iMX6
## (double hashtag) Command inside a container in the target device (Torizon)
## Command inside a container in Torizon
> (greater-than sign) Command in the bootloader (e.g. U-Boot console)
> Command in the Bootloader
No symbol: Command output
$ Command waiting for output
Output
Prerequisites
Step 1
Turn on the board. After boot, the Portainer login screen will be displayed on the monitor connected to the board. On the first access, it is necessary to set a username and password.
Alternatively, a host computer connected to the same network as the module can also access Portainer through a web interface. To access it, open a web browser (Chrome, Firefox, Edge) and access the address: <your-board-ip>:8840
.
Step 2
Select the primary endpoint to access the board's container settings.
Step 3
Click on Containers.
Step 4
Click on the button "Add container".
Step 5
Type a name for your container. Type the following Docker image name: hello-world
. Click on "Deploy the container".
Step 6
The next screen will show the running containers. Press F5
to update the container status until your hello-world container finishes its execution and stops.
After the container stops, click on the Logs button.
Step 7
See the container log. If you see the Hello from Docker!
text, congratulations, your container has been successfully started from the Portainer interface.
The hello-world container is only a simple container used to verify if the Docker engine is working correctly in the system and if the Portainer can start a container on the board. We will build more complex containers in the next sections.
Step 8
The image TorizonCore with evaluation containers has many different demos. Explore it by going to the App Templates section in Portainer and click on one of the templates.
FAQ
I don't want to expose the Portainer service on a TCP/IP port. Can I disable it?
Yes, you can disable Portainer from the system startup. You must access the terminal and disable the corresponding system service, or modify the default docker-compose.yml.
Read more about this by learning how to automatically start a container, on the article Run and Manage Docker Container on Torizon
Where can I learn more about Portainer?
For more information regarding Portainer, read through the article Run and Manage Containers with Portainer and the Command-line on Torizon and through Portainer's documentation.