Ich habe es jedes Mal überprüft, wenn ich es mehrmals gemacht habe, also habe ich es zusammengefasst. Ich habe nichts Besonderes gemacht.
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
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Fügen Sie Docker Yum Repository mit hinzu
$ sudo yum install docker-ce docker-ce-cli containerd.io
Bestätigen Sie, wenn Sie fertig sind
$ docker --version
Docker version 19.03.5, build 633a0ea
Einstellungen für Servicestart und Autostart
$ sudo systemctl start docker
$ sudo systemctl enable docker
https://github.com/docker/compose/releases
Wenn nicht, installieren Sie die Locke
$ 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
Bestätigung
$ docker-compose --version
docker-compose version 1.25.4, build 8d51620a
Versetzen Sie sich in die Docker-Gruppe. Jetzt können Sie Docker-Compose ohne Sudo. Melden Sie sich danach ab und wieder an.
$ sudo usermod -aG docker $USER
Erstellen Sie docker-compose.yml zur Bestätigung.
$ 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
das ist alles.
Recommended Posts