티스토리 뷰

Backend/Docker

CentOS8에 Docker 설치하기

out of coding 2020. 3. 24. 19:23

이 페이지에 가면 설명이 충분이 있기는 합니다.

https://docs.docker.com/install/

 

저는 CentOS에 해볼라고 합니다.

https://docs.docker.com/install/linux/docker-ce/centos/

 

1. Set up the Repository

- Install required packages

$ sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

- stable repository

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

2. To install a specific version of Docker Engine

$ yum list docker-ce --showduplicates | sort -r

 

여기서 나오는 버전을 가지고 install 하여 주면 됩니다.

$ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

2-Error.

package docker-ce-3:19.03.8-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed

 문제: 

  - cannot install the best candidate for the job

  - package containerd.io-1.2.10-3.2.el7.x86_64 is excluded

  - package containerd.io-1.2.13-3.1.el7.x86_64 is excluded

  - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded

  - package containerd.io-1.2.2-3.el7.x86_64 is excluded

  - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded

  - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded

  - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded

(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

원인: CentOS8에서 하다보니까 생기는 문제입니다.

해결 : 뒤에 --nobest를 붙여줍니다. 뭔가 좀 찜찜하기는 하네요. 조만간 해결 되겠죠.

 

3. System에 등록

$ sudo systemctl enable docker
$ sudo systemctl start docker

4. Test

$ docker run hello-world

이렇게 하면 아래에 주욱 뜹니다.

 

Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

1b930d010525: Pull complete

Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e

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/

 

5. 마무리

VirtualBox에서 이것저것 설치하면서 구동하였는데 도커는 정말 쉽네요.

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함