Raspberry Pi – install docker.io & network in a deep dive mode on Ubuntu Server 20.10

# apt-get update -y
# apt-get full-upgrade -y
# hostnamectl set-hostname rpi-iot-jsho-tools-02
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy
# apt-get install docker.io
# systemctl enable –now docker
# docker –version
Docker version 19.03.13, build 4484c46
# docker run hello-world
Unable to find image ‚hello-world:latest‘ locally
latest: Pulling from library/hello-world
256ab8fe8778: Pull complete
Digest: sha256:31b9c7d48790f0d8c50ab433d9c3b7e17666d6993084c002c2ff1ca09b96391d
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/
# apt-get install net-tools
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
net-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 190 kB of archives.
After this operation, 831 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports groovy/main arm64 net-tools arm64 1.60+git20180626.aebd88e-1ubuntu2 [190 kB]
Fetched 190 kB in 0s (581 kB/s)
Selecting previously unselected package net-tools.
(Reading database … 102236 files and directories currently installed.)
Preparing to unpack …/net-tools_1.60+git20180626.aebd88e-1ubuntu2_arm64.deb …
Unpacking net-tools (1.60+git20180626.aebd88e-1ubuntu2) …
Setting up net-tools (1.60+git20180626.aebd88e-1ubuntu2) …
Processing triggers for man-db (2.9.3-2) …
# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:70ff:fe71:23cc prefixlen 64 scopeid 0x20<link>
ether 02:42:70:71:23:cc txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 220 (220.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.141 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2003:d4:c739:7b00:dea6:32ff:fe59:3fcc prefixlen 64 scopeid 0x0<global>
inet6 fe80::dea6:32ff:fe59:3fcc prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:59:3f:cc txqueuelen 1000 (Ethernet)
RX packets 48604 bytes 54391330 (54.3 MB)
RX errors 0 dropped 1736 overruns 0 frame 0
TX packets 12141 bytes 1158378 (1.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 136 bytes 11496 (11.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 136 bytes 11496 (11.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# docker network ls
NETWORK ID NAME DRIVER SCOPE
b772d441d3cf bridge bridge local
a4f5207ad27d host host local
84d120f5b7b0 none null local
(–rm) Clean up
(-it ) For interactive processes (like a shell) you must use -i -t together
in order to allocate a tty for the container process
(–name) Name
# docker run –rm -it –name one –hostname iot-jsho-docker-01 ubuntu /bin/bash
root@iot-jsho-docker-01:/#
# docker network inspect bridge
[
{
„Name“: „bridge“,
„Id“: „b772d441d3cf33324d6d3032cc9c4243e703b749944f3c245f5d6253cac2e8fa“,
„Created“: „2021-01-30T13:56:43.857160155Z“,
„Scope“: „local“,
„Driver“: „bridge“,
„EnableIPv6“: false,
„IPAM“: {
„Driver“: „default“,
„Options“: null,
„Config“: [
{
„Subnet“: „172.17.0.0/16“
}
]
},
„Internal“: false,
„Attachable“: false,
„Ingress“: false,
„ConfigFrom“: {
„Network“: „“
},
„ConfigOnly“: false,
„Containers“: {},
„Options“: {
„com.docker.network.bridge.default_bridge“: „true“,
„com.docker.network.bridge.enable_icc“: „true“,
„com.docker.network.bridge.enable_ip_masquerade“: „true“,
„com.docker.network.bridge.host_binding_ipv4“: „0.0.0.0“,
„com.docker.network.bridge.name“: „docker0“,
„com.docker.network.driver.mtu“: „1500“
},
„Labels“: {}
}
# docker network create jsho-docker –subnet=10.0.0.0/8
48185ed15c92be9fd7ae0df3d1a986d480cfd2644ee9e68f21ac6e863ca4ac4b
# ifconfig
br-48185ed15c92: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 10.0.0.1 netmask 255.0.0.0 broadcast 10.255.255.255
ether 02:42:48:9d:6c:e3 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:70ff:fe71:23cc prefixlen 64 scopeid 0x20<link>
ether 02:42:70:71:23:cc txqueuelen 0 (Ethernet)
RX packets 6963 bytes 375349 (375.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 14409 bytes 21774962 (21.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.141 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2003:d4:c703:9e00:dea6:32ff:fe59:3fcc prefixlen 64 scopeid 0x0<global>
inet6 fe80::dea6:32ff:fe59:3fcc prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:59:3f:cc txqueuelen 1000 (Ethernet)
RX packets 631767 bytes 226948523 (226.9 MB)
RX errors 0 dropped 79612 overruns 0 frame 0
TX packets 52804 bytes 4512153 (4.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 226 bytes 20482 (20.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 226 bytes 20482 (20.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# docker network ls
NETWORK ID NAME DRIVER SCOPE
b772d441d3cf bridge bridge local
a4f5207ad27d host host local
48185ed15c92 jsho-docker bridge local
84d120f5b7b0 none null local
# docker network inspect jsho-docker
[
{
„Name“: „jsho-docker“,
„Id“: „48185ed15c92be9fd7ae0df3d1a986d480cfd2644ee9e68f21ac6e863ca4ac4b“,
„Created“: „2021-01-31T11:50:55.199543038Z“,
„Scope“: „local“,
„Driver“: „bridge“,
„EnableIPv6“: false,
„IPAM“: {
„Driver“: „default“,
„Options“: {},
„Config“: [
{
„Subnet“: „10.0.0.0/8“
}
]
},
„Internal“: false,
„Attachable“: false,
„Ingress“: false,
„ConfigFrom“: {
„Network“: „“
},
„ConfigOnly“: false,
„Containers“: {},
„Options“: {},
„Labels“: {}
}
]
# docker run –rm -it –name two –net jsho-docker –hostname iot-jsho-docker-02 ubuntu /bin/bash
root@iot-jsho-docker-02:/#
# docker network connect bridge two

Leave a Reply

You must be logged in to post a comment.