Bash scripting cheatsheet
https://devhints.io/bash.html?fbclid=IwAR1R2IpkCczUiwzHuLnb4ENrOEgsoTIltaU8IiYAuSAXRFQn2b7m6xDTNE0
https://devhints.io/bash.html?fbclid=IwAR1R2IpkCczUiwzHuLnb4ENrOEgsoTIltaU8IiYAuSAXRFQn2b7m6xDTNE0
FROM docker.io/centos:7.4.1708
# 사용자 지정 USER root # 언어셋 설치 RUN yum clean all \ && yum repolist \ && yum -y update \ && sed -i "s/en_US/all/" /etc/yum.conf \ && yum -y reinstall glibc-common # 기본적으로 필요한 OS 패키지를 설치한다. RUN yum -y install tar unzip vi vim telnet net-tools curl openssl \ && yum -y install apr apr-util apr-devel apr-util-devel \ && yum -y install elinks locate python-setuptools \ && yum clean all RUN yum install -y openssh-server \ && yum install -y sudo ENV LANG=ko_KR.utf8 TZ=Asia/Seoul RUN echo "root:root" | chpasswd # 컨테이너 실행시 실행될 명령 CMD ["/bin/bash"] |
Dockerfile Build
docker build -t centosksh:v1 . |
Docker 실행 1
docker run --privileged -it -e container=docker -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 22 --name=centosksh1 centosksh:v1 /usr/sbin/init |
Docker 실행 2
docker run --privileged -it -e container=docker -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 32000:22 --name=centosksh2 centosksh:v1 /usr/sbin/init |
sshd service 시작
service sshd start |
instance 접속
ssh -p 32772 root@localhost ssh -p 32000 root@localhost |
https://www.confluent.io/blog/publishing-apache-kafka-new-york-times/