본문 바로가기
개발/Docker

[Docker] docker 설치(Windows 10)

by jeomn 2021. 12. 24.

도커 개발 환경 설정

  1. WSL2 설치

    해당 메뉴얼 참고 : Microsoft 메뉴얼

    가. Windows10 버전 확인

      가) x64시스템(64bit) : 버전 1903이상, 빌드 18362 이상

      나) ARM64 시스템: 버전 2004이상, 빌드 19041이상

      이보다 낮은 버전일 경우, WSL2를 지원하지 않습니다. 윈도우 업데이트 필수!

 

    나. 명령 프롬프트(cmd) 관리자 권한으로 실행 

관리자 권한으로 명령 프롬프트 실행

    다. Linux용 Windows 하위 시스템 옵션 사용 설정

$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

    실행 시

배포 이미지 서비스 및 관리 도구
버전: 10.0.19041.844

이미지 버전: 10.0.19042.1415

기능을 사용하도록 설정하는 중
[==========================100.0%==========================]
작업을 완료했습니다.

 

    라. Virtual Machine 플랫폼 옵션 기능 사용 설정

$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

    실행 시

배포 이미지 서비스 및 관리 도구
버전: 10.0.19041.844

이미지 버전: 10.0.19042.1415

기능을 사용하도록 설정하는 중
[==========================100.0%==========================]
작업을 완료했습니다.

 

    마. Linux 커널 업데이트 최신 패키지 다운로드

    공식 문서에서 제공하는 URL: x64 머신용 최신 WSL2 Linux 커널 업데이트 패키지

    ARM64 머신을 사용하는 경우: ARM64 패키지

    다운로드 이후, 실행하여 설치함

 

    바. WSL2로 사용 설정

$ wsl --set-default-version 2

    실행 시

WSL 2와의 주요 차이점에 대한 자세한 내용은 https://aka.ms/wsl2를 참조하세요
작업을 완료했습니다.

 

  2. 도커 설치: 사이트에서 OS버전에 따라 Docker Desktop 설치

  https://www.docker.com/products/docker-desktop

 

Docker Desktop for Mac and Windows | Docker

Learn why Docker Desktop is the preferred choice for millions of developers building containerized applications. Download for Mac or Windows.

www.docker.com

 

    가. docker 버전 확인

$ docker -v

//결과
Docker version 20.10.11, build dea9396

 

    나. docker 컨테이너 실행 확인 테스트

$ docker run hello-world

  실행 시, 자동으로 hello world 도커 이미지가 다운로드되어 실행됨

  "Hello from Docker!!"를 시작으로 하는 결과가 출력되면 성공

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

 

 


처음에 Desktop Docker 설치를 먼저 진행했었는데, Desktop Docker 창에서 WSL2가 필요하다고 경고창으로 알려줬다... 친절하게 메뉴얼 링크도 알려줘서 수월하게 설정하고, 테스트까지 진행했다!

이런 안내창의 중요함...그리고 해결할 수 있게 도와주는 친절함은 UI 개발 시 사용자 편의성을 위해 필요한 것임을 느꼈다.

'개발 > Docker' 카테고리의 다른 글

[Docker] DB연결 실습(MySQL)  (0) 2021.12.24
[Docker]배포 실습-backend(SpringBoot)  (0) 2021.12.24
[Docker] 배포 실습-frontend(Vue.js)  (0) 2021.12.24
[Docker] 기본 명령어 실습  (0) 2021.12.24

댓글