- docker 설치를 위한 디렉토리를 생성 및 이동한다.
mkdir /usr/local/src/docker-installer
cd /usr/local/src/docker-installer
- 아래의 목록을 다운로드 한다.(http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/)
wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/fuse3-libs-3.6.1-4.el7.x86_64.rpm
wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/slirp4netns-0.4.3-4.el7_8.x86_64.rpm
- 아래의 목록을 다운로드 한다.(https://download.docker.com/linux/centos/7/x86_64/stable/Packages/)
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.6.21-3.1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-compose-plugin-2.18.1-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-buildx-plugin-0.10.5-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-24.0.1-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-rootless-extras-24.0.2-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-24.0.1-1.el7.x86_64.rpm
- yum local repository 설정
https://powergi.tistory.com/entry/yum-local-repository-%EB%A7%8C%EB%93%A4%EA%B8%B0
- 위에서 다운받은 패키지를 설치한다.
yum install -y container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
yum install -y containerd.io-1.6.21-3.1.el7.x86_64.rpm
yum install -y docker-compose-plugin-2.18.1-1.el7.x86_64.rpm
yum install -y docker-buildx-plugin-0.10.5-1.el7.x86_64.rpm
yum install -y docker-ce-cli-24.0.1-1.el7.x86_64.rpm
yum install -y fuse3-libs-3.6.1-4.el7.x86_64.rpm
yum install -y fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
yum install -y slirp4netns-0.4.3-4.el7_8.x86_64.rpm
yum install -y docker-ce-rootless-extras-24.0.2-1.el7.x86_64.rpm docker-ce-24.0.1-1.el7.x86_64.rpm
- docker 실행
systemctl enable docker
systemctl start docker
- docker 권한 설정
chmod 666 /var/run/docker.sock
usermod -aG docker ${USER}
- docker 저장 위치 변경
mkdir -p /test/docker/docker-root
vi /etc/docker/daemon.json
systemctl start docker
# daemon.json
{
"data-root": "/test/docker/docker-root"
}