CentOS Stream 8 是 Red Hat 企業級 Linux (RHEL) 的一個上游公共開發分支,旨在提供一種持續交付的發行版,定位于 Fedora Linux 和 RHEL 之間?以下是關于 CentOS Stream 8 容器化實踐的一些基本步驟和指南:
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
vim /etc/ssh/sshd_config
passwd root
systemctl restart sshd
ssh root@localhost -p 5022
docker commit centos-test centos:ssh
--allowerasing
參數解決?--privileged
選項?以上步驟和指南為在 CentOS Stream 8 上進行容器化實踐提供了基礎的操作流程?根據具體需求,可能還需要進行更多的配置和調整。