I checked it every time I did it several times, so I summarized it. I haven't done anything special.
https://docs.docker.com/install/linux/docker-ce/centos/
$ sudo yum -y update
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
devicemapper
storage driver$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Add docker yum repository with
$ sudo yum install docker-ce docker-ce-cli containerd.io
Confirm when completed
$ docker --version
Docker version 19.03.5, build 633a0ea
Service start and auto start settings
$ sudo systemctl start docker
$ sudo systemctl enable docker
https://github.com/docker/compose/releases
If not, install curl
$ sudo yum install -y curl
Installation
$ sudo curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
Verification
$ docker-compose --version
docker-compose version 1.25.4, build 8d51620a
Put yourself in the docker group. Now you can docker-compose without sudo. If you do this, log out and log in again.
$ sudo usermod -aG docker $USER
Create docker-compose.yml for confirmation.
$ vim docker-compose.yml
version: "3"
services:
hello:
image: hello-world:latest
docker-compose up!
$ docker-compose up
Creating network "vagrant_default" with the default driver
Pulling hello (hello-world:latest)...
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:9572f7cdcee8591948c2963463447a53466950b3fc15a247fcad1917ca215a2f
Status: Downloaded newer image for hello-world:latest
Creating vagrant_hello_1 ... done
Attaching to vagrant_hello_1
hello_1 |
hello_1 | Hello from Docker!
hello_1 | This message shows that your installation appears to be working correctly.
hello_1 |
hello_1 | To generate this message, Docker took the following steps:
hello_1 | 1. The Docker client contacted the Docker daemon.
hello_1 | 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
hello_1 | (amd64)
hello_1 | 3. The Docker daemon created a new container from that image which runs the
hello_1 | executable that produces the output you are currently reading.
hello_1 | 4. The Docker daemon streamed that output to the Docker client, which sent it
hello_1 | to your terminal.
hello_1 |
hello_1 | To try something more ambitious, you can run an Ubuntu container with:
hello_1 | $ docker run -it ubuntu bash
hello_1 |
hello_1 | Share images, automate workflows, and more with a free Docker ID:
hello_1 | https://hub.docker.com/
hello_1 |
hello_1 | For more examples and ideas, visit:
hello_1 | https://docs.docker.com/get-started/
hello_1 |
vagrant_hello_1 exited with code 0
that's all.
Recommended Posts