인프라/Docker

Window10에서 Docker 설치하기

Ssemi-Column 2022. 7. 11. 15:18
728x90

* 준비사항 Window 10 Pro...

* Wsl 2 (https://hacktiming.tistory.com/15, https://www.lesstif.com/software-architect/wsl-2-windows-subsystem-for-linux-2-preview-71401661.html)

 

❗Window에 ubuntu 설치하기

1. 시작 메뉴에서 Windows 기능 켜기/끄기 선택
2. 시작 - 설정 - 업데이트 및 보안 - 개발자용 - 개발자 모드 On
3. Linux용 Windows 하위 시스템 설치 후 재부팅
4. 시작 메뉴에서 Microsoft Store 실행
5. ubuntu 검색 및 설치 후 실행

* 이후 접속 아이디와 비밀번호를 설정하면 끝

 


❗ubuntu에 docker 설치하기 (참고 :https://mungiyo.tistory.com/11)

1. apt 업데이트, 패키지 설치

$ sudo apt-get update && upgrade
$ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

2. GPG 키 , 저장소 추가

$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

3. 도커 설치

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

4. 도커 설치 확인

$ sudo docker -v

5. 도커 설치 확인 Hello-world

$ sudo docker run --rm Hello-world


$ sudo usermod -aG docker $USER // sudo 명령어 없이 docker 실행하기

 

* docker run hello-world Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

=>  docker service가 실행되고 있지 않아서 생긴 오류

$ sudo service docker start
$ sudo service docker status

 

* System has not been booted with systemd as init system (PID 1). Can't operate 오류

$ sudo apt-get install cgroupfs-mount
$ sudo cgroupfs-mount
$ sudo service docker start

 

 

728x90
반응형
LIST