CentOS Stream 8 是 Red Hat 企业级 Linux (RHEL) 的一个上游公共开发分支,旨在提供一种持续交付的发行版,定位于 Fedora Linux 和 RHEL 之间。以下是关于 CentOS Stream 8 容器化实践的一些基本步骤和指南:
在 CentOS Stream 8 上安装 Docker 的步骤如下:
sudo dnf update -y
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install docker-ce --nobest -y
sudo systemctl start docker
sudo systemctl enable docker
docker --version
docker run -itd --privileged --name centos-test -p 5022:22 centos:centos8 /usr/sbin/init
docker exec -it centos-test /bin/bash
yum update -y
yum install openssh-server vim passwd openssh-clients net-tools -y
systemctl start sshd
systemctl enable sshd
vim /etc/ssh/sshd_config
# 取消 Port、ListenAddress、PermitRootLogin、PubkeyAuthentication 的注释
passwd root
systemctl restart sshd
ssh root@localhost -p 5022
docker commit centos-test centos:ssh
--allowerasing
参数解决。--privileged
选项。以上步骤和指南为在 CentOS Stream 8 上进行容器化实践提供了基础的操作流程。根据具体需求,可能还需要进行更多的配置和调整。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:CentOS Stream 8虚拟化实践