Setting up firewall
Docker requires legacy iptables
to configure firewall rules for it's interfaces. To switch iptables
to legacy run following command:
Code Block |
---|
|
update-alternatives --set iptables /usr/sbin/iptables-legacy |
Installing docker
To install docker run following command:
Code Block |
---|
|
sudo apt update
sudo apt install docker.io |
Running docker
...
Table of Contents |
---|
minLevel | 1 |
---|
maxLevel | 6 |
---|
outline | false |
---|
style | none |
---|
type | list |
---|
printable | false |
---|
|
1. Running Docker
To start the docker daemon run:
Code Block |
---|
sudo systemctl start docker |
To check everything is working, run the docker info
:
Code Block |
---|
user@imx8mpnavq:~$ sudo docker info
Client:
Context: default
Debug Mode: false
Server:
Containers: 3
Running: 0
Paused: 0
Stopped: 3
Images: 1
Server Version: 20.10.21
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log:
awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
io.containerd.runtime.v1.linux
Default Runtime: runc
Init Binary: docker-init
containerd version:
runc version:
init version:
Security Options:
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.71-0.0.1-355-07080005-53a60de8e5+g2ef8cc43ed08
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 3.544GiB
Name: imx8mpnavq
ID: HGBJ:23QS:K5Z2:TP6B:BULI:PEWO:AD5X:ZMTM:MLKL:XOQQ:GUZO:HCQN
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false |
2. Running “Hello, world!”
Pull and run the first container, “hellohello-
world”world
:
Code Block |
---|
sudo docker run hello-world |
3. Post-install
...
Configuration
If you want to run docker without root privileges, add user
to the docker
group:
Code Block |
---|
|
sudo usermod -aG docker $USER |
...