You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/boards/portenta-x8/tutorials/docker-container/content.md
+52-32
Original file line number
Diff line number
Diff line change
@@ -16,44 +16,48 @@ hardware:
16
16
17
17
## Overview
18
18
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.
20
20
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.
22
22
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)
24
24
25
25
## Goals
26
26
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
- 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.***
38
41
39
42
## Using Docker
40
43
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
+
42
46
```
43
47
docker -v
44
48
```
45
49
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).***
47
51
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/).
49
53
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.
51
55
52
-
### Install A Container
56
+
### How to Install a Container
53
57
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.
55
59
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.
57
61
58
62
```
59
63
docker pull hello-world
@@ -63,54 +67,70 @@ docker pull hello-world
63
67
64
68
### Run The Installed Container
65
69
70
+
This is the command to begin the container instance.
71
+
66
72
```
67
73
docker run hello-world
68
74
```
69
75
70
76

71
77
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`***
73
79
74
80
### 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
+
76
84
```
77
85
docker ps -a
78
86
```
79
87
80
-

88
+

81
89
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:
83
91
84
-
If you didn't run your container you can also check if it's correctly installed by using:
85
92
```
86
93
docker images
87
94
```
88
95
89
96

90
97
91
-
### Uninstall A Container
98
+
### How to Uninstall A Container
92
99
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.
94
101
95
-
Then use the remove (`rm`) command
96
102
```
97
103
docker container rm <CONTAINER ID>
98
104
```
99
105
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
+
```
101
113
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***
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.
107
127
108
128
## Conclusion
109
129
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.
111
131
112
132
### Next Steps
113
133
114
134
- 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