Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview

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

Running Docker

To start the docker daemon run:

Code Block
user@rzv2hevkalpha:~$ sudo systemctl start docker

To check everything is working, run the docker info:

Code Block
user@rzv2hevkalpha:~$ sudo docker info
[sudo] password for user: 
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

Running “Hello, world!”

Pull and run the first container, hello-world:

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

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

Code Block
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/

Post-install Configuration

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

Code Block
user@rzv2hevkalpha:~$ sudo usermod -aG docker $USER

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

Code Block
user@rzv2hevkalpha:~$ user@imx8mpnavq:~$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
user@rzv2hevkalpha:~$ docker ps -a
CONTAINER ID   IMAGE         COMMAND    CREATED         STATUS                     PORTS     NAMES
cd01f7523abb   hello-world   "/hello"   5 minutes ago   Exited (0) 5 minutes ago             happy_maxwell
user@rzv2hevkalpha:~$ docker image ls
REPOSITORY    TAG       IMAGE ID       CREATED        SIZE
hello-world   latest    b038788ddb22   7 months ago   9.14kB