Docker 설치 및 실행 (Ubuntu 환경)

정기용·2023년 7월 19일
0

Docker

목록 보기
1/4


수많은 에러들을 뚫고 설치할 수 있는 방법.

기본 설치

(선택사항) root 계정에 접속한다.

> su
> [password 입력]

다운로드에 필요한 패키지들을 설치한다. (ca-certificates, curl, gnupg, lsb_release)

>  sudo apt-get update
>  sudo apt-get install ca-certificates curl gnupg

docker download script를 docker 홈페이지에서 다운 받아 실행한다.

>  curl -fsSL https://get.docker.com -o get-docker.sh
>  sudo sh get-docker.sh

설치가 되었는지 확인하기 위해 hello-world:image를 실행시켜본다.

>  sudo docker run hello-world

“”“
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:---
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.
“”“

도커가 잘 실행됐다면 위 메시지가 나온다.
실행이 안됐다면 아래 방법들을 시도해서 해결할 수 있다.

에러 해결하기

Hyper-v 사용권한 설정하기

Hyper-v를 사용할 수 있도록 설정한다.

>  bcdedit /set hypervisorlaunchtype auto

BIOS에서 VM 사용권한 설정하기

그리고 다음 과정을 통해 BIOS 환경에서 VM 사용 제한을 해제한다.

  1. BIOS에서 VM을 설정하기 위해 컴퓨터 리부팅한다.
  2. 리부팅 과정(검정색 화면)에서 F2와 또는 Delete 키를 연타한다. (연타 방법 동영상)
  3. 이후 BIOS 설정에서 advanced mode에서 Intel Virtualization Technology 설정을 enable로 변경한다. (과정 동영상)

다시 컴퓨터를 키면 Docker를 실행할 수 있다.

>  docker version

리눅스 관리자 권한 설정하기

일반 사용자가 관리자 권한이 없어 sudo 명령어로만 docker가 실행된다면 사용자를 Docker 그룹에 추가할 수 있다.

>  sudo usermod -aG docker $USER
profile
SKKU CS 23

0개의 댓글