Docker 설치 (window, linux)
Windows Docker 설치
Docker Desktop을 성공적으로 설치하려면 Windows 시스템이 다음 요구 사항을 충족해야 합니다.
Install Docker Desktop on Windows
docs.docker.com
Windows 10 Pro Enterprise 또는 Education이 있는 경우 WSL2 와 Hyper-v가 켜져 있어야 합니다.
Hyper-V 설치
Enable Hyper-V on Windows 10
Install Hyper-V on Windows 10
docs.microsoft.com
먼저 Hyper-V를 활성화 하려면 powershell 에서 다음과 같은 명령어를 입력해주면 됩니다.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
WSL2 설치
Install WSL
Install Windows Subsystem for Linux with the command, wsl --install. Use a Bash terminal on your Windows machine run by your preferred Linux distribution - Ubuntu, Debian, SUSE, Kali, Fedora, Pengwin, Alpine, and more are available.
docs.microsoft.com
위 사이트에 들어가서 WSL 설치 페이지를 보고 따라하시면 WSL2 가 설치됩니다.
wsl --install
다만 WSL1이 설치된 경우 Version2로 업그레이드 하시면 됩니다.
Docker setting
WSL2를 끄고 Hyper-V 로만 도작하게 할 수 있습니다.
Linux Docker 설치
오래된 Docker 버전 삭제
sudo apt-get remove docker docker-engine docker.io containerd runc
리포지토리 설정🔗
리포지토리를 사용할 수 있도록 패키지를 업데이트하고 apt
패키지를 설치합니다 .
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
Docker 공식 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
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
Docker engine 설치
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Docker 설치 확인
sudo docker run hello-world