Recent Posts

Ubuntu 18.04 Docker image on Raspberry pi 4


In the prospect of Application development, Docker plays a vital role in securing and also providing in-dependencies over the platform as it could run anywhere.

Docker is considered as http server package at the initial stages, but once the working environment (Container Host)becomes a container, literally boosted its usage.

It runs over the kernel, obviously started under Linux now stepping into multiple platforms as Linux Kernel extends its support over other architectures.

credit:floydhilton
Docker works over the host OS - on which docker is installed but has privileges to access kernel, hence the OS used inside Docker, the Base OS can be anything but works with Docker kernel,actually the Host OS kernel.

We all knew, the difficulties of Installing one operating system over the other.But, Docker can be a solution where, OS works as package of Container rather than a bootable disk.

Containers can be increased so, the number of Operating system can also be increased at some level.

The reason Docker access Kernel is for accessing the web application layers of MAC address and Network devices but now it is covered all the kernel elements to gain full control.

The thing we are going to do here is Installing Docker on Raspberry Pi 4 and then working on Ubuntu 18.04 inside it.

Obviously the steps are pretty much simple,

Raspbian Buster doesn't have native support as its kernel being updated with respect to issues faced by hardwares.

So, the porting of Raspbian Stretch packages will be used as Buster.

Before getting into installing docker, run the update command as follows,

sudo apt update -y

because raspbian by default has been under testing repo so we need to update into a stable one.

sudo apt-get update doesn't provide any update as it is final version of tested repo.

We will be installing packages of docker with respect to container,client,docker.

wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/containerd.io_1.2.6-3_armhf.deb

wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/docker-ce-cli_18.09.7~3-0~debian-buster_armhf.deb

wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/docker-ce_18.09.7~3-0~debian-buster_armhf.deb

dpkg -i containerd.io_1.2.6-3_armhf.deb

dpkg -i docker-ce-cli_18.09.7~3-0~debian-buster_armhf.deb

dpkg -i docker-ce_18.09.7~3-0~debian-buster_armhf.deb

Adding Pi user rights,

sudo usermod pi -aG docker

The basic level installation is over, but inside Docker we will be network issue as Kernel of raspbian doesn't provide feasibility, hence adding raspbian stretch repo into source list will give access to network settings of host OS(not kernel).

To do that,

sudo nano /etc/apt/sources.list

add the following line in the file,

deb https://download.docker.com/linux/raspbian/ stretch stable

Now, run the command,

docker run hello-world

reply from the docker will be found.

The next step into running Ubuntu 18.04, which is pretty much simple in Docker,

Just run the command,

docker run -it ubuntu

this downloads the packages of ubuntu and get ready for execution rather than booting,installation and many other process in a VM or even a system.

Thus, Container inside a system enables to find several varieties of OS inside one kernel which is really good one as it eliminates the non-opensource kernels.

Now,Major web app based on docker can be used in the container and build a docker image for future usage.

The real next step is running android in the docker for which, am going to try anbox inside the docker as it is now a ubuntu system.

Will update on this in the future.

Post a Comment

0 Comments