1、下载openEuler,在虚拟机上安装openEuler
2、查看openEuler和安装docker
--openEuler查看版本号
[qyq@openeuler ~]$ cat /etc/openEuler-release
openEuler release 22.03 (LTS-SP1)
[qyq@openeuler ~]$
[qyq@openeuler ~]$ cat /etc/os-release
NAME="openEuler"
VERSION="22.03 (LTS-SP1)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP1)"
ANSI_COLOR="0;31"
[qyq@openeuler ~]$
[qyq@openeuler ~]$ uname -a
Linux openeuler 5.10.0-136.12.0.86.oe2203sp1.x86_64 #1 SMP Tue Dec 27 17:50:15 CST 2022 x86_64 x86_64 x86_64 GNU/Linux
[qyq@openeuler ~]$
--openEuler查看yum源配置
[qyq@openeuler ~]$ cat /etc/yum.repos.d/openEuler.repo |grep -v ^#|head -10
[OS]
name=OS
baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP1/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP1/OS/$basearch/RPM-GPG-KEY-openEuler
[everything]
name=everything
[qyq@openeuler ~]$
--openEuler安装docker引擎
[qyq@openeuler ~]$ sudo yum install -y docker
[sudo] qyq 的密码:
Last metadata expiration check: 1:00:39 ago on 2023年01月12日 星期四 12时57分47秒.
Package docker-engine-2:18.09.0-316.oe2203sp1.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[qyq@openeuler ~]$ rpm -qa|grep docker
docker-engine-18.09.0-316.oe2203sp1.x86_64
[qyq@openeuler ~]$
3、openEuler 系统的docker服务启停
--查看docker 服务的状态,依然是用systemctl
[qyq@openeuler ~]$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2023-01-12 13:53:58 CST; 15min ago
Docs: https://docs.docker.com
Main PID: 8922 (dockerd)
Tasks: 20 (limit: 8939)
Memory: 274.2M
CGroup: /system.slice/docker.service
├─ 8922 /usr/bin/dockerd --live-restore
└─ 8928 containerd --config /var/run/docker/containerd/containerd.toml --log-level info
1月 12 13:53:58 openeuler dockerd[8922]: time="2023-01-12T13:53:58.008046817+08:00" level=info msg="Setup IP tables begin"
1月 12 13:53:58 openeuler dockerd[8922]: time="2023-01-12T13:53:58.108477150+08:00" level=info msg="Setup IP tables end"
1月 12 13:53:58 openeuler dockerd[8922]: time="2023-01-12T13:53:58.178187633+08:00" level=info msg="Loading containers: done."
1月 12 13:53:58 openeuler dockerd[8922]: time="2023-01-12T13:53:58.281023046+08:00" level=info msg="Docker daemon" commit=9b9af2f graphdriver(s)=overlay2 version=18.09.0
1月 12 13:53:58 openeuler dockerd[8922]: time="2023-01-12T13:53:58.281179240+08:00" level=info msg="Daemon has completed initialization"
1月 12 13:53:58 openeuler dockerd[8922]: time="2023-01-12T13:53:58.285324277+08:00" level=warning msg="Could not register builder git source: failed to find git binary: >
1月 12 13:53:58 openeuler dockerd[8922]: time="2023-01-12T13:53:58.298511265+08:00" level=info msg="API listen on /var/run/docker.sock"
1月 12 13:53:58 openeuler systemd[1]: Started Docker Application Container Engine.
1月 12 13:54:27 openeuler dockerd[8922]: time="2023-01-12T13:54:27.667907447+08:00" level=info msg="received image create request, name:almalinux:latest repo:"
1月 12 13:54:54 openeuler dockerd[8922]: time="2023-01-12T13:54:54.379484733+08:00" level=info msg="image create request process success, name:almalinux:latest repo:"
[qyq@openeuler ~]$
--查看系统是否随系统启动,也是用systemctl is-enabled
[qyq@openeuler ~]$ sudo systemctl is-enabled docker
enabled
[qyq@openeuler ~]$
4、openEuler 防火墙管理
openEuler默认采用firewall-cmd进行管理,iptables默认是禁用状态。文章来源地址https://www.toymoban.com/news/detail-579106.html
[qyq@openeuler ~]$ sudo systemctl is-enabled firewalld
enabled
[qyq@openeuler ~]$ sudo systemctl is-enabled iptables
disabled
[qyq@openeuler ~]$
[qyq@openeuler ~]$ sudo systemctl status iptables
○ iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; vendor preset: disabled)
Active: inactive (dead)
[qyq@openeuler ~]$
[qyq@openeuler ~]$ sudo systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-01-12 12:18:12 CST; 2h 23min ago
Docs: man:firewalld(1)
Main PID: 779 (firewalld)
Tasks: 2 (limit: 8939)
Memory: 38.1M
CGroup: /system.slice/firewalld.service
└─ 779 /usr/bin/python3 -s /usr/sbin/firewalld --nofork --nopid
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t nat -X DOCKER' failed: iptables: No chain/target/match by that name.
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER' failed: iptables: No chain/target/match by that name.
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER' failed: iptables: No chain/target/match by that name.
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION-STAGE-1' failed: iptables: No chain/target/matc>
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION-STAGE-1' failed: iptables: No chain/target/matc>
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION-STAGE-2' failed: iptables: No chain/target/matc>
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION-STAGE-2' failed: iptables: No chain/target/matc>
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION' failed: iptables: No chain/target/match by tha>
1月 12 13:53:57 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION' failed: iptables: No chain/target/match by tha>
1月 12 13:53:58 openeuler firewalld[779]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a >
[qyq@openeuler ~]$
[qyq@openeuler ~]$ sudo yum install firewalld
Last metadata expiration check: 1:38:46 ago on 2023年01月12日 星期四 12时57分47秒.
Package firewalld-1.0.2-5.oe2203sp1.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[qyq@openeuler ~]$ sudo rpm -qa|grep firewalld
firewalld-1.0.2-5.oe2203sp1.noarch
[qyq@openeuler ~]$ sudo firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: dhcpv6-client mdns ssh
ports:
protocols:
forward: yes
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[qyq@openeuler ~]$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (1 references)
target prot opt source destination
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
[qyq@openeuler ~]$
文章来源:https://www.toymoban.com/news/detail-579106.html
到了这里,关于openEuler 22.03 LTS-SP1体验安装docker、防火墙配置等的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!