Docker Guide: Difference between revisions

From Variscite Wiki
No edit summary
Line 34: Line 34:
  $ bitbake var-image-docker (for the rootfs to be installed on the eMMC)
  $ bitbake var-image-docker (for the rootfs to be installed on the eMMC)


== Generate a Field Update file (.swu image) ==
== Test Docker  ==
*  Make your changes in {{#var:BUILD_FOLDER}}
check internet connection
*  Edit the sw-description file
root@imx8mm-var-dart:~# ping www.google.com
*  Generate .swu file:
$ bitbake var-image-swu


== Test SWUpdate  ==
Get target ip address
* Get the target's IP address using ifconfig
Open ssh terminal:  
* Open a web browser on the host and connect to the SWUpdate web server on the target by entering the following in the address bar:
ssh root@<ip address>
<nowiki>http://<target_ip>:8080</nowiki>
 
* On the web page, click "Browse..." and open the .swu image which is located at tmp/deploy/images/{{#var:MACHINE_NAME}}/var-image-swu-{{#var:MACHINE_NAME}}.swu
root@imx8mm-var-dart:~# docker --version
Docker version 18.09.3-ce, build f5e591e
 
root@imx8mm-var-dart:~# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
256ab8fe8778: Pull complete
Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
Status: Downloaded newer image for hello-world:latest
root@imx8mm-var-dart:~# docker images
REPOSITORY          TAG                IMAGE ID            CREATED            SIZE
hello-world        latest              a29f45ccde2a        3 months ago        9.14kB
root@imx8mm-var-dart:~# docker run hello-world
 
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.

Revision as of 17:45, 9 April 2020

Docker Introduction

<https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-debian-9> Docker is an application that simplifies the process of managing application processes in containers.
Containers let you run your applications in resource-isolated processes. They’re similar to virtual machines, but containers
are more portable, more resource-friendly, and more dependent on the host operating system.

For a detailed introduction to the different components of a Docker container, check out The Docker Ecosystem: An Introduction to
Common Components.

You can check SWUpdate's online documentation at: http://sbabic.github.io/swupdate
This Introduction was taken from the SWUpdate README.md at: https://github.com/sbabic/swupdate

Yocto Integration

Recipes

Before you begin, get familiar with the Varicite Yocto Build Release guide.

Variscite provides the following image recipes:

  • var-image-docker - Based on fsl-image-core with the following differences:
    • xxxxxxxxxxxxxx


Create a Docker-ready Image

  • Follow steps 1-3 of the Yocto Build Release page.
  • Build a recovery SD card and the var-image-swupdate image as the recovery image
$ cd 
$ MACHINE= DISTRO=
$ bitbake var-image-docker (for the rootfs to be installed on the eMMC)

Test Docker

check internet connection root@imx8mm-var-dart:~# ping www.google.com

Get target ip address Open ssh terminal: ssh root@<ip address>

root@imx8mm-var-dart:~# docker --version Docker version 18.09.3-ce, build f5e591e

root@imx8mm-var-dart:~# docker pull hello-world Using default tag: latest latest: Pulling from library/hello-world 256ab8fe8778: Pull complete Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e Status: Downloaded newer image for hello-world:latest root@imx8mm-var-dart:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest a29f45ccde2a 3 months ago 9.14kB root@imx8mm-var-dart:~# docker run hello-world

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.