Skip to content

Commit 25c9965

Browse files
committed
User manual documentation update (For Docker)
1 parent 1da2433 commit 25c9965

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

content/hardware/04.pro/boards/portenta-x8/tutorials/01.user-manual/content.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -628,32 +628,33 @@ An example of how to use the command:
628628
journalctl --since "2022-12-22 12:20:00" --until yesterday
629629
```
630630

631-
### Developing and Deploying Custom Docker Containers on Portenta X8
631+
### Working with Docker on Portenta X8
632632

633-
To customize the Portenta X8, you can develop and deploy Docker containers. Start by provisioning your device as described in the [**Portenta X8 with Arduino Cloud**](#portenta-x8-with-arduino-cloud) section.
633+
To customize the Portenta X8, you can develop and deploy Docker containers. Start by ensuring Docker is correctly set up on your device. A quick way to test Docker functionality is by running the official `Hello World` container from [Docker Hub](https://hub.docker.com/).
634634

635-
Once ready, you can customize Portenta X8, for example, Thing and Dashboard. This can be done by writing your own Python script leveraging the [Arduino IoT Cloud Python library](https://github.com/arduino/arduino-iot-cloud-py). Check the documentation and the examples inside the library to learn more about creating your own Python application.
636-
637-
When your Python script is ready, you have to create a dedicated Dockerfile to integrate your new script. The Dockerfile needs the Arduino Linux Wizard Python container (i.e., `arduino-ootb-python-devel`) to interact with your Arduino Cloud account correctly.
638-
639-
So, open a terminal window and create a Dockerfile integrating the following code with your Python script:
635+
First, pull the image using the following command:
640636

641637
```bash
642-
FROM arduino/arduino-ootb-python-devel:latest
638+
docker pull hello-world
643639
```
644640

645-
```bash
646-
# Copy custom python cloud scripts
647-
COPY ./custom-examples /root/custom-examples
648-
```
641+
Then, run the container:
649642

650643
```bash
651-
RUN chmod -R 755 /root/custom-examples
644+
docker run hello-world
652645
```
653646

647+
This simple process pulls and runs the `Hello World` container, verifying that Docker is available and functional on your Portenta X8. The following clip shows running the `Hello World` container briefly:
648+
649+
![Hello World container on the Portenta X8](assets/docker-run-example.gif)
650+
651+
With this, you can start customizing the Portenta X8 by creating and deploying containers tailored to your needs. For example, you can develop Python applications or other utilities and package them into Docker containers for deployment.
652+
653+
***You can explore [__Arduino's Docker Hub__](https://hub.docker.com/u/arduino) for a repository of preconfigured Docker images designed to simplify development on the Portenta X8.***
654+
654655
#### Build Your Container
655656

656-
You can create your custom containers and build them inside the Portenta X8. Since Portenta X8 is based on an arm64 architecture, you can use the command `build` only if you build the container directly on an arm64 architecture (e.g., Macbook based on M1/M2 processor or Portenta X8). Open a terminal window and type:
657+
You can create your custom containers and build them inside the Portenta X8. Since Portenta X8 is based on an *arm64 architecture*, you can use the command `build` only if you build the container directly on an *arm64 architecture* (e.g., Macbook based on M1/M2 processor or Portenta X8). Open a terminal window and type:
657658

658659
```bash
659660
docker build . -t x8-custom-devel
@@ -671,7 +672,7 @@ It is time for you to deploy the newly created Docker image. To do so, save it s
671672

672673
#### Managing Early Start Services When Building Custom Containers
673674

674-
The Portenta X8 firmware includes **`compose-apps-early-start.service`**, which starts certain Docker Compose applications early during the boot process. This feature helps pre-configured services run smoothly but may sometimes interfere with custom containers you pull or build.
675+
The Portenta X8 firmware includes the **`compose-apps-early-start.service`**, which starts certain Docker Compose applications early during the boot process. This feature helps pre-configured services run smoothly but may sometimes interfere with custom containers you pull or build.
675676

676677
For example, system tools like [**Skopeo**](https://www.redhat.com/en/topics/containers/what-is-skopeo) may automatically remove containers without warning. This can happen to containers pulled from external sources or locally built on the device. If you notice that your custom containers are being removed unexpectedly, you can solve this by managing the system services with a few command lines.
677678

@@ -692,7 +693,6 @@ systemctl stop compose-apps-early-start.service && systemctl stop compose-apps-e
692693

693694
Stopping and disabling these services will prevent the early start of compose applications, ensuring your custom containers are not removed automatically. Additionally, make sure to check for the [*latest firmware image*](https://downloads.arduino.cc/portentax8image/image-latest.tar.gz) to maintain compatibility and optimal performance of the Portenta X8 with custom container developments.
694695

695-
696696
#### Deploy Your Container With Docker Hub
697697

698698
If you have a [Docker Hub account](https://hub.docker.com/), you can freely upload your Docker image to your registry (e.g., `yourhubusername`):
@@ -780,7 +780,7 @@ services:
780780
It is now time to upload the new `docker-compose.yml` to your Portenta X8:
781781

782782
```bash
783-
docker-compose up --detach
783+
docker compose up --detach
784784
```
785785

786786
And you are ready to go! Your Portenta X8 Dashboards and Things can be customized using the same process multiple times.

0 commit comments

Comments
 (0)