Skip to content

Commit cd4279a

Browse files
[PC-1026] Portenta X8: Container Management with Docker & Python on Linux Redefinition (#334)
* Initial Commit - Content clean base * Tutorial content minor update * Docker management tutorial major update * Added small bootloader flash link (Portenta X8) * tutorial content minor update * Tutorial content update * Tutorial content update * Tutorial content minor update * Update content/hardware/04.pro/boards/portenta-x8/tutorials/docker-container/content.md Co-authored-by: Julián Caro Linares <[email protected]> * Update content/hardware/04.pro/boards/portenta-x8/tutorials/docker-container/content.md Co-authored-by: Julián Caro Linares <[email protected]> * Tutorial content minor update * Tutorial content minor update --------- Co-authored-by: Julián Caro Linares <[email protected]>
1 parent d7cf216 commit cd4279a

File tree

1 file changed

+52
-32
lines changed
  • content/hardware/04.pro/boards/portenta-x8/tutorials/docker-container

1 file changed

+52
-32
lines changed

content/hardware/04.pro/boards/portenta-x8/tutorials/docker-container/content.md

+52-32
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,48 @@ hardware:
1616

1717
## Overview
1818

19-
[Docker](http://docker.com) Is a platform full of applications, called containers. Containers are isolated solutions and thus they don't have to depend on your environment. Making them portable and consistent throughout development, testing and production.
19+
[Docker](http://docker.com) is a platform full of applications, called containers. Containers are isolated solutions, thus they don't have to depend on your environment. Making them portable and consistent throughout development, testing, and production.
2020

21-
You can download, install, use and share applications in the form of containers. You can find all the available containers on the [hub.docker.com](https://hub.docker.com) page.
21+
You can download, install, use, and share applications in the form of containers. You can find all the available container images on the [hub.docker.com](https://hub.docker.com) page.
2222

23-
In this tutorial we will go through the steps of how to install, run and remove the [Hello-World Container](https://hub.docker.com/_/hello-world)
23+
In this tutorial, we will go through the steps of how to install, run and remove Docker's official [Hello-World image](https://hub.docker.com/_/hello-world)
2424

2525
## Goals
2626

27-
- List the installed and running containers
28-
- Install a container
29-
- Run a container manually
30-
- Uninstall a container
27+
- Learn how to list installed and active containers
28+
- Learn how to install a container
29+
- Learn how to run a container manually
30+
- Learn how to uninstall a container
3131

32-
### Required Hardware and Software
32+
### Hardware and Software Requirements
3333

34-
- [Arduino Portenta X8](https://store.arduino.cc/products/portenta-x8)
34+
- [Arduino® Portenta X8](https://store.arduino.cc/products/portenta-x8)
3535
- USB-C® cable (either USB-C® to USB-A or USB-C® to USB-C®)
36-
- Wi-Fi Access Point with Internet Access
37-
- ADB or SSH. [Check how to connect to your Portenta X8](/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal)
36+
- Wi-Fi® Access Point with Internet Access
37+
- ADB, [Check how to connect to your Portenta X8](/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal)
38+
- [Arduino IDE 1.8.10+](https://www.arduino.cc/en/software), [Arduino IDE 2.0+](https://www.arduino.cc/en/software), or [Arduino Web Editor](https://create.arduino.cc/editor)
39+
40+
***Make sure to have the Portenta X8 with the latest image as well as bootloader. Please check [how to flash your Portenta X8](/tutorials/portenta-x8/image-flashing) to have latest version.***
3841

3942
## Using Docker
4043

41-
The Docker CLI comes with your Portenta X8 by default, you can check if the tool is installed by typing:
44+
The Portenta X8 provides Docker CLI by default. The following command will help you verify if it is installed correctly:
45+
4246
```
4347
docker -v
4448
```
4549

46-
***To use this tool, first of all you will need to connect to your device, check [how to connect using adb/ssh](/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal).***
50+
***To use this tool, you will need to connect to your device first. Check [how to connect using adb/ssh](/tutorials/portenta-x8/out-of-the-box#controlling-portenta-x8-through-the-terminal).***
4751

48-
You can check the Docker reference documentation, which covers all the features of the tool in depth at [docs.docker.com](https://docs.docker.com/).
52+
You can check the Docker's reference documentation, which covers all the features of the tool in depth at [docs.docker.com](https://docs.docker.com/).
4953

50-
The following steps shows how to install, run and uninstall the "Hello World" container.
54+
The following steps will show how to install, run and uninstall the "Hello World" container.
5155

52-
### Install A Container
56+
### How to Install a Container
5357

54-
You will need to find your Docker container, on its Docker hub page it will show you how to install the desired container.
58+
First, you will need to search for ["Hello World" container image](https://hub.docker.com/_/hello-world). The container image can be found within Docker hub, where you will be able to find variety of readily-available container images. It will be used to verify docker is working as intended with the Portenta X8.
5559

56-
https://hub.docker.com/_/hello-world
60+
The following command must be used to pull the `hello-world` image. The Docker hub page for images have the instructions to pull the image and deploy the container.
5761

5862
```
5963
docker pull hello-world
@@ -63,54 +67,70 @@ docker pull hello-world
6367

6468
### Run The Installed Container
6569

70+
This is the command to begin the container instance.
71+
6672
```
6773
docker run hello-world
6874
```
6975

7076
![Docker CLI running Hello World app](assets/docker-run.png)
7177

72-
***To be able to see your container with `docker ps -a` you will need to run it at least once with `docker run`***
78+
***To be able to see an active container with `docker ps -a`, you will need to run it at least once with `docker run`***
7379

7480
### Listing The Installed Packages
75-
List the installed containers with the following command:
81+
82+
The following command will display the active containers and will show the `hello-world` container if it was able to run successfully. The `STATUS` message will let you know if the container is active or has finished operation depending on its purpose.
83+
7684
```
7785
docker ps -a
7886
```
7987

80-
![Docker CLI listing all the installed containers](assets/docker-ps.png)
88+
![Docker CLI listing all the active containers](assets/docker-ps.png)
8189

82-
Keep in mind that you will need to get the `CONTAINER ID` to uninstall the container afterwards.
90+
The list of available images, including installed `hello-world` image can be verified using the following command:
8391

84-
If you didn't run your container you can also check if it's correctly installed by using:
8592
```
8693
docker images
8794
```
8895

8996
![Docker CLI images](assets/docker-images.png)
9097

91-
### Uninstall A Container
98+
### How to Uninstall A Container
9299

93-
First get the Container ID from the container list.
100+
You will need to obtain assigned `CONTAINER ID` to be able to remove a container of choice. The list of active containers provides this information. The remove (`rm`) command is then used with the desired container identifier to proceed with removal process.
94101

95-
Then use the remove (`rm`) command
96102
```
97103
docker container rm <CONTAINER ID>
98104
```
99105

100-
In this case we run `docker ps -a` and copy the `CONTAINER_ID` which in this case is `c44ba77b65cb`.
106+
For this example, the command `docker ps -a` will show the `CONTAINER ID` of the `hello-world` container designated as: `c44ba77b65cb`. If you encounter an error stating that the container cannot be removed, it may mean that the container has an actively ongoing operation which can be checked with `STATUS` message.
107+
108+
Granted that this is the case, you will need to stop the container and verify with `STATUS` message that it has exited successfully. To do this, following command is used:
109+
110+
```
111+
docker stop <CONTAINER ID>
112+
```
101113

102-
***`CONTAINER_ID` changes its value every time you re-install them***
114+
***Every time the image is re-installed or re-ran, the `CONTAINER ID` will be different than the previous identifier***
103115

104116
![Docker CLI container uninstall](assets/docker-container-rm.png)
105117

106-
If you run `docker images` again you will see that the container is not showing up anymore.
118+
Using the `docker ps -a` after container removal, the `hello-world` container should no longer be present as an active container.
119+
120+
The same goes for the images if you would like to free some space. The removal command will now be as follows using `IMAGE ID` found within image table:
121+
122+
```
123+
docker rmi <IMAGE ID>
124+
```
125+
126+
If you run `docker images` again, you will see that the `hello-world` image is not showing up anymore.
107127

108128
## Conclusion
109129

110-
In this tutorial you learned how to install a container onto your device, run it and manage it.
130+
In this tutorial, you have learned how to use Docker with Portenta X8. You have learned to download an image, manage, and deploy the container, and ultimately run on Portenta X8. You have also learned to remove the image and the container to control Portenta X8's available resources.
111131

112132
### Next Steps
113133

114134
- Now that you have the base of the workflow to use [Docker](https://docker.com), go to its docs page and make sure you understand all the features.
115-
- Look for a container from [Docker hub](http://hub.docker.com), install it and make your own application out of it.
116-
- Create a container to run your custom made application.
135+
- Look for a container image from [Docker hub](http://hub.docker.com), install it and make your own application out of it.
136+
- Create a container to run your custom made application. For this, it may interest you [Create and Upload a Custom Container to the Portenta X8](tutorials/portenta-x8/custom-container) tutorial.

0 commit comments

Comments
 (0)