Docker 설치
Install Docker Engine on Ubuntu
To get started with Docker Engine on Ubuntu, make sure you meet the prerequisites, then install Docker. To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions: Ubuntu Kinetic 22.10 Ubuntu Jammy 22.04 (LTS) Ubuntu Focal 20.04 (LTS) Ubuntu Bionic 18.04 (LTS) Docker Engine is compatible with x86_64 (or amd64), armhf, arm64, and s390x architectures.
Install Docker
# Update the apt package index and install packages
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
# Add Docker’s official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Set up the repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Docker enable 설정
우분투는 자동으로 enable 설정이 되어있다.
systemctl status dockerCentOS의 경우는
#도커 데몬 실행
systemctl start docker
#도커 enable 설정
systemctl status docker
systemctl enable docker
Docker 버전 확인
docker version
docker info
OS 사용자에게 Docker 권한 부여
su -
usermod -a -G docker guru
su - guru
docker ps