Starting with v4.2.1, NVIDIA JetPack includes a beta version of NVIDIA Container Runtime with Docker integration for the Jetson platform. This is essential because it enables users to run GPU accelerated Deep Learning and HPC containers on Jetson devices. This sounds good but to build, deploy and scale microservices, you will require Docker Compose. Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.
Running Docker Compose on Jetson Nano can be a daunting task. You just can’t use the usual curl command to get it installed. In this blog post, I will show you how to get Docker and Docker Compose installed on your NVIDIA Jetson Nano board in 5 minutes.
Hardware
- Jetson Nano
- A Camera Module
- A 5V 4Ampere Charger
- 64GB SD card
Software
- Jetson SD card image from https://developer.nvidia.com/embedded/downloads
- Etcher software installed on your system
Preparing Your Raspberry Pi Flashing Jetson SD Card Image
- Unzip the SD card image
- Insert SD card into your system.
- Bring up Etcher tool and select the target SD card to which you want to flash the image.
Verifying if it is shipped with Docker Binaries
ajeetraina@ajeetraina-desktop:~$ sudo docker version
[sudo] password for ajeetraina:
Client:
Version: 19.03.6
API version: 1.40
Go version: go1.12.17
Git commit: 369ce74a3c
Built: Fri Feb 28 23:47:53 2020
OS/Arch: linux/arm64
Experimental: false
Server:
Engine:
Version: 19.03.6
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: 369ce74a3c
Built: Wed Feb 19 01:06:16 2020
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.3.3-0ubuntu1~18.04.2
GitCommit:
runc:
Version: spec: 1.0.1-dev
GitCommit:
docker-init:
Version: 0.18.0
GitCommit:
Checking Docker runtime
pico@pico1:/tmp/docker-build$ sudo nvidia-docker version
NVIDIA Docker: 2.0.3
Client:
Version: 19.03.6
API version: 1.40
Go version: go1.12.17
Git commit: 369ce74a3c
Built: Fri Feb 28 23:47:53 2020
OS/Arch: linux/arm64
Experimental: false
Server:
Engine:
Version: 19.03.6
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: 369ce74a3c
Built: Wed Feb 19 01:06:16 2020
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.3.3-0ubuntu1~18.04.2
GitCommit:
runc:
Version: spec: 1.0.1-dev
GitCommit:
docker-init:
Version: 0.18.0
GitCommit:
Installing Docker Compose on Jetson Nano
Jetson Nano doesn’t come with Docker Compose installed by default. You will need to first install the below list of pre-requisite packages in the right order as shown below:
export DOCKER_COMPOSE_VERSION=1.27.4
sudo apt-get install libhdf5-dev
sudo apt-get install libssl-dev
apt install python3
apt install python3-pip
sudo pip3 install docker-compose=="${DOCKER_COMPOSE_VERSION}"
pip install docker-compose
Please note that docker compose require python 3.x. I would suggest you to remove Python 2.7 or lower versions if it exists for the smooth installation of the packages.
Verify Docker Compose installation
docker-compose version
docker-compose version 1.26.2, build unknown
docker-py version: 4.3.1
CPython version: 3.6.9
OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
Let’s run Minecraft server using docker compose. First we will create a docker compose file as shown below:
pico@pico1:~$ cat docker-compose.yml
version: '3.7'
services:
minecraft:
image: itzg/minecraft-server:multiarch
ports:
- "25590:25565"
environment:
EULA: "TRUE"
deploy:
resources:
limits:
memory: 1.5G
Running the Minecraft Server
sudo docker-compose up
WARNING: Some services (minecraft) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
Creating network "pico_default" with the default driver
Creating pico_minecraft_1 ... done
Attaching to pico_minecraft_1
minecraft_1 | [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Aug 9 18:11 /data'
minecraft_1 | [init] Resolved version given LATEST into 1.16.3
minecraft_1 | [init] Resolving type given VANILLA
minecraft_1 | [init] Downloading minecraft_server.1.16.3.jar ...
minecraft_1 | [init] Creating server.properties in /data/server.properties
minecraft_1 | [init] Setting server-name to 'Dedicated Server' in /data/server.properties
minecraft_1 | [init] Skip setting server-ip
minecraft_1 | [init] Setting server-port to '25565' in /data/server.properties
....
In my future blog, I will show you how to use Docker Compose for NVIDIA Jetson Nano GPU for the first time.
Comments are closed.