Docker Document (Docker+Yocto)
Docker Document (Docker+Yocto)
• Docker is a software platform that allows you to build, test, and deploy applications quickly.
Docker packages software into standardized units called containers that have everything the
software needs to run including libraries, system tools, code, and runtime.
• 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.
**************************************************************************
➔ If you need to add a user to the docker group that you’re not logged in as, declare that username
explicitly using:
• sudo usermod -aG docker username
********************************************************************************
Step 1 — Installing Docker(Ubuntu 18.04.6 LTS)
➔ First, update your existing list of packages:
• sudo apt update
➔ Install a few prerequisite packages which let apt use packages over HTTPS:
•sudo apt install apt-transport-https ca-certificates curl software-properties-
common
➔ Then add the GPG key for the official Docker repository to your system:
• curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
➔ Add the Docker repository to APT sources:
• sudo add-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/ubuntu bionic stable"
➔ Next, update the package database with the Docker packages from the newly added repo:
• sudo apt update
➔ Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
• apt-cache policy docker-ce
docker-ce:
Installed: (none)
Candidate: 18.03.1~ce~3-0~ubuntu
Version table:
18.03.1~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
➔ Finally, install Docker
• sudo apt install docker-ce
➔ Docker should now be installed, the daemon started, and the process enabled to start on boot.
Check that it’s running:
• sudo systemctl status docker● docker.service - Docker Application Container
Engine
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-08-09 19:42:32 UTC; 33s ago
Docs: https://docs.docker.com
Main PID: 5231 (dockerd)
Tasks: 7
CGroup: /system.slice/docker.service
└─5231 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Step 2 — Executing the Docker Command Without
➔ If you want to avoid typing sudo whenever you run the docker command, add your username to
the docker group:
• sudo usermod -aG docker ${USER}
➔ To apply the new group membership, log out of the server and back in, or type the following:
• su - ${USER}
➔ You will be prompted to enter your user’s password to continue. Confirm that your user is now
added to the docker group by typing:
• groupsOutput
phytec sudo docker
➔ If you need to add a user to the docker group that you’re not logged in as, declare that username
explicitly using:
sudo usermod -aG docker username
**************************************************************************
➔ Now we can search for images available on Docker Hub by using the docker command with the
search subcommand. For example, to search for the Ubuntu image, type:
• docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL
AUTOMATED
ubuntu Ubuntu is a Debian-based Linux operating sys… 10908 [OK]
dorowu/ubuntu-desktop-lxde-vnc Docker image to provide HTML5 VNC interface … 428 [OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of offi… 244 [OK]
consol/ubuntu-xfce-vnc Ubuntu container with "headless" VNC session… 218 [OK]
ubuntu-upstart Upstart is an event-based replacement for th… 108 [OK]
ansible/ubuntu14.04-ansible Ubuntu 14.04 LTS with
...
➔ Execute the following command to download the official ubuntu image to your computer:
• docker pull ubuntu:16.04
Using default tag: latest
latest: Pulling from library/ubuntu
d51af753c3d3: Pull complete
fc878cd0a91c: Pull complete
6154df8ff988: Pull complete
fee5db0ff82f: Pull complete
Digest: sha256:747d2dbbaaee995098c9792d99bd333c6783ce56150d1b11e333bbceed5c54d7
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest
➔ To see the images that have been downloaded to your computer, type:
• docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 1d622ef86b13 3 weeks ago 73.9MB
hello-world latest bf756fb1ae65 4 months ago 13.3kB
USER SIDE :
1. To view all available subcommands, type.
• docker
2. To view system-wide information about Docker, use.
• docker info
3. To search for images available on Docker Hub by using the docker command with the search subcommand. For
example, to search for the Ubuntu image, type.
• docker search ubuntu
4. Execute the following command to download the official ubuntu image to your computer.
• docker pull ubuntu(version)
5. To run a container using the latest image of Ubuntu. The combination of the -i and -t switches gives you
interactive shell access into the container.
• docker run -it ubuntu(version)
6. Add your username to the docker group with permission
• sudo usermod -aG docker ${USER}
7. To apply the new group membership, log out of the server and back in, or type the following, this requres users
password to contineu.
• su - ${USER}
CONTAINER SIDE:
1. Once we get the container ID, we can use the container using command
• docker start <container ID>
2. To attach with the container
• docker attach <container ID>
Building with Docker + Yocto(rba5d2x)
➔ To run the following code from host machine
➢ root@6e73c5008118:/#
➢ apt-get update
➢ apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential
chrpath socat libsdl1.2-dev
➢ dpkg-reconfigure locales
export LC_ALL=en_US.UTF-8
dockerexport LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
4) Now run
source ~/.bashrc
still error*******
ans:- apt-get install language-pack-en-base
➔ Verify that the preferred shell for your Host PC is ''bash'' and not ''dash'':
➢ dpkg-reconfigure dash
➢ mkdir yocto_rba5d2x
➢ cd yocto_rba5d2x
➢ mkdir sources
➢ cd sourcesls
come back from the sources directory to configure the build system and start the build process.
➢ Cd ../
Building
SD Card Flash Images:
➢ vi conf/local.conf
➢ MACHINE ?= "rugged-board-a5d2x-sd1"
iii) Compile the images for SDCARD Flash using below command.
➢ bitbake rb-sd-core-image-minimal
iv) After completion of this compiling please go to below path to get the SDCARD
Flash images.
➢ cd tmp/deploy/images/rugged-board-a5d2x-sd1/
➢ vi conf/local.conf
➢ MACHINE ?= "rugged-board-a5d2x"
o iii) Compile the images for NOR Flash using below command.
➢ bitbake rb-nor-core-image-minimal
iv) After completion of this compiling, please go to below path to get the NOR Flash images.
➢ cd tmp/deploy/images/rugged-board-a5d2x/
ERRORS
ERROR: OE-core's config sanity checker detected a potential misconfiguration. Either fix the cause of
this error or at your own risk disable the checker (see sanity.conf). Following is the list of potential
problems / advisories:
SOLUTION:
touch conf/sanity.conf
After setup build environment, you directly jump into the build directory. so from there, you run the
below command.
SOLUTION:
vi /yocto_rba5d2x/sources/poky/../meta-rba5d2x/recipes-bsp/at91bootstrap/at91bootstrap_git.bb
require at91bootstrap.inc
DEFAULT_PREFERENCE = "-1"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"
PV = "3.8+git${SRCPV}"
LIC_FILES_CHKSUM = "file://main.c;endline=27;md5=a2a70db58191379e2550cbed95449fbd"
NOTE: Skipping as already exists in sysroot: ['upm-data', 'lighttpd-data', 'mraa-data', 'gcc-runtime', 'quilt-
native', 'gcc-cross-arm', 'musl', 'libmodbus-data', 'python3', 'libjpeg-turbo', 'zlib', 'libpcre', 'openssl', 'json-
c', 'libgcc', 'linux-libc-headers', 'autoconf-native', 'zlib-native', 'binutils-cross-arm', 'libmpc-native', 'xz-
native', 'libtool-native', 'automake-native', 'texinfo-dummy-native', 'gnu-config-native', 'flex-native', 'gmp-
native', 'mpfr-native', 'bsd-headers', 'sqlite3', 'libffi', 'xz', 'gdbm', 'bzip2', 'readline', 'cryptodev-linux', 'm4-
native', 'bison-native', 'gettext-minimal-native', 'opkg-utils', 'ncurses']
/yocto_rba5d2x/build/tmp/work/cortexa5hf-neon-poky-linux-musleabi/data-image/1.0-r0/temp/
run.do_install.29306: 131: /yocto_rba5d2x/build/tmp/work/cortexa5hf-neon-poky-linux-musleabi/data-
image/1.0-r0/temp/run.do_install.29306: /usr/sbin/mkfs.jffs2: not found
SOLUTION:
imx6ul:
ERROR: OE-core's config sanity checker detected a potential misconfiguration. Either fix the cause of
this error or at your own risk disable the checker (see sanity.conf). Following is the list of potential
problems / advisories:
Touch conf/sanity.conf
vi source/poky/meta/classes/sanity.bbclass----740
error
Python can't change the filesystem locale after loading so we need a UTF-8 when
Python starts or things won't work.
$ export LC_ALL="en_US.UTF-8"
$ bitbake core-image-base
docker images
docker ps -a
docker start brave_swirles
docker exec -it 4123baafedcf /bin/bash
docker stop container_name
docker rm container_name
vim /etc/apt/sources.list
apt-get update
apt-get upgrade
//apt update && apt-get install -y linux-headers-*
///etc/apt/sources.list.d dpkg --get-selections | grep linux-image