docker run -d -p 8023:22 -v /opt/playground:/home/limithot/docker-volume/playground-centos8 –name playground-centos814 -it –privileged centos:8 /sbin/init

[설명]
-d => detach
-p 8023:22 => fowarded port
-v /opt/playground:/home/limithot/docker-volume/playground-centos8 => volume mount
–name playground-centos814 => container name
-it => interactive
–privileged => systemd 사용
centos:8 => 사용 아미지
/sbin/init => 실행명령

%%추가
dnf install openssh-server => sshd 설치
systemctl enable sshd => sshd 활성화
systemctl restart sshd => sshd 시작

Leave a Reply

Your email address will not be published. Required fields are marked *