Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This application note explains how to use the docker 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.

Running Docker

The docker daemon starts up autonomously and needs no manual startingon 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:

...

Running “Hello, world!”

Pull and run the first Docker 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:

...

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

Disabling and

...

Enabling Docker

It may be useful to disable the docker daemon service if it’s not utilized to save resourcesit'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 during boot , run:

Code Block
user@rzv2hevkalpha:~$ sudo systemctl disable docker
Removed /etc/systemd/system/multi-user.target.wants/docker.service.

To enable the docker service auto-start during boot , run:

Code Block
user@rzv2hevkalpha:~$ sudo systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.

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

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

To manually start the docker daemon, run:

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

...