Using Docker

1. Overview

This application note explains how to use the Docker platform in the Emcraft software distribution for the Renesas RZ/V2H SoC.

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security lets you run many containers simultaneously on a given host. Containers are lightweight and contain everything needed to run the application, so you don't need to rely on what's installed on the host. You can share containers while you work, and be sure that everyone you share with gets the same container that works in the same way.

1.1. Running Docker

The docker daemon starts up autonomously on boot-up of Linux on the target. No manual action is launched to launch the docker .

To check everything is working, run the docker info:

user@rzv2hevkalpha:~$ sudo docker info Client: Version: 24.0.5 Context: default Debug Mode: false Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 24.0.5 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: runc version: init version: Security Options: seccomp Profile: builtin cgroupns Kernel Version: 5.10.145-cip17-0.0.1-34-12150405+gdf43561f711a Operating System: Ubuntu 22.04.1 LTS OSType: linux Architecture: aarch64 CPUs: 4 Total Memory: 14.86GiB Name: rzv2hevkalpha ID: 42221a95-4bfc-4598-b9b9-3d65438145b2 Docker Root Dir: /var/lib/docker Debug Mode: false Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

1.2. Running “Hello, world!”

Pull and run the first Docker container, hello-world:

user@rzv2hevkalpha:~$ sudo docker run hello-world

The docker would download the hello-world image and run it:

Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 70f5ac315c5a: Pull complete Digest: sha256:3155e04f30ad5e4629fac67d6789f8809d74fea22d4e9a82f757d28cee79e0c5 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (arm64v8) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/

1.3. Post-install Configuration

If you want to run docker without root privileges, add user to the docker group:

After you log out and log back, you can run docker commands without sudo:

2. Disabling and Enabling Docker

It may be useful to disable the docker daemon service if it's not utilised in your target application. This would save some resources and improve the target boot time.

To disable the docker service auto-start, run:

To enable the docker service auto-start, run:

To manually stop the docker daemon in the current session, run:

To manually start the docker daemon, run: