Je l'ai vérifié à chaque fois que je l'ai fait plusieurs fois, alors je l'ai résumé. Je n'ai rien fait de spécial.
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
de docker$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Ajouter le référentiel docker yum avec
$ sudo yum install docker-ce docker-ce-cli containerd.io
Confirmer une fois terminé
$ docker --version
Docker version 19.03.5, build 633a0ea
Paramètres de démarrage du service et de démarrage automatique
$ sudo systemctl start docker
$ sudo systemctl enable docker
https://github.com/docker/compose/releases
Sinon, installez 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
Vérification
$ docker-compose --version
docker-compose version 1.25.4, build 8d51620a
Mettez-vous dans le groupe des dockers. Vous pouvez maintenant docker-composer sans sudo. Si vous faites cela, déconnectez-vous et reconnectez-vous.
$ sudo usermod -aG docker $USER
Créez docker-compose.yml pour 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
c'est tout.
Recommended Posts