티스토리 뷰
yum
repository 관리에 필요한 yum-utils
를 설치한다. (설치가 안되어있을 경우)
$ sudo yum install -y yum-utils
Docker repository 추가
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Docker Engine 설치
$ sudo yum install docker-ce docker-ce-cli containerd.io
Docker 실행
$ sudo systemctl start docker
hellow-world
이미지로 Docker가 잘 설치 되었는지 확인
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:975f4b14f326b05db86e16de00144f9c12257553bba9484fed41f9b6f2257800
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/
dnf
를 이용하여 설치할 때도 yum
을 이용할때와 거의 동일하다.
$ sudo dnf -y install dnf-plugins-core
$ sudo dnf config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
$ sudo dnf install docker-ce docker-ce-cli containerd.io
참고
'운영체제 > 리눅스' 카테고리의 다른 글
[CentOS7] PostgreSQL 13 설치 및 실행 방법 (3) | 2021.08.31 |
---|---|
[CentOS7] Logstash grok patterns (0) | 2021.08.31 |
[CentOS7] yum으로 Elastic Stack 설치 (2) | 2021.08.09 |
[CentOS 7] gitlab https 설정 (0) | 2018.07.06 |
[CentOS 7] gitlab 백업 (0) | 2018.07.06 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday