Up to this point, you have been running pre-existing images from Docker Hub, built by Toradex or other third-party. But it is possible to create your own Docker image to load whatever application you wish. To fulfill this goal, the Dockerfiles exist.
In this section, you will:
For this Getting Started Guide:
For this lesson:
Note: Carefully read this module's cover page clicking on "Module 3: Creating my Own Container" on the left menu bar before starting this lesson.
In your Linux machine, create a new folder named getting-started on the Desktop and a new file named
Dockerfile inside it. Copy the following content into the newly created file:
Note: a standard
Dockerfile has no extension, therefore make sure your file is not named
Dockerfile.txt, especially since file extensions are hidden by default. Consult this lesson's FAQ for details about naming.
FROM torizon/arm32v7-debian-base RUN apt update && apt install nano -y
Note: If you wish, modify the Dockerfile to include more commands, such as
RUN apt install python.
Open Powershell, login to Docker CLI:
Follow the prompt with your Docker Hub credentials.
Enter your getting-started folder and build the image:
docker build -t <username>/gs-torizon .
Note that this username is your Docker username.
Upload the image to your Docker Hub:
docker push <username>/gs-torizon