This repository contains example code for the article published here
To run this project locally create a virtual environment and install on dependencies by running:
python3.7 -m venv venv
source venv/bin/activate
pip install -r requirements.txtNow you can simply run the application
python app.pyAnd test it in seperate terminal
curl localhost:8080To follow along you will have to change icetekio into your Docker Hub username, or organization that you have write access to. This includes this commands, and also the manifest.yaml file.
Running simple test on machine, to check if python image is supported on this image and docker is working correctly.
docker run -it python:3.8 python -c 'print("Hello world!")'Building the image.
docker build -t icetekio/nodeinfo:fixedarch . Running the container with our test image.
docker run --name nodeinfo -d -p 8080:8080 icetekio/nodeinfo:fixedarch
curl localhost:8080NOTE: The -d detaches the container. If you want to see it logs, then you can run docker logs nodeinfo of run the image with interactive mode by switching the -d flag with -it.
Pushing image to the docker registry.
docker push icetekio/nodeinfo:fixedarchNOTE: Before running this command you have to be login to docker registry.
Commands that were run on Raspberry Pi, Jetson Nano and Laptop to build images for specific architecture
Laptop
docker build -t icetekio/nodeinfo:multiarch-amd64 .
docker push icetekio/nodeinfo:multiarch-amd64Raspberry Pi
docker build -t icetekio/nodeinfo:multiarch-arm32 .
docker push icetekio/nodeinfo:multiarch-arm32NVIDIA Jetson Nano
docker build -t icetekio/nodeinfo:multiarch-arm64.
docker push icetekio/nodeinfo:multiarch-arm64Creating a manifest
manifest-tool --debug push from-spec manifest.yamlKept cool 🧊 by Icetek