安装Docker&Docker-compose

首先是一切的基础,其实我感觉这玩意还挺像安卓Magisk/Xposed这种无损热插拔操作的,适合我这种手残配置错了又还原不回去只能重装系统的……

  • 脚本自动安装Docker
$ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
  • 启动docker
$ sudo systemctl enable docker
$ sudo systemctl start docker
  • 测试Docker是否正确安装
$ docker run --rm hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24
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/

若能正常输出以上信息,则说明安装成功。

  • 安装docker compose
$ sudo curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

$ sudo chmod +x /usr/local/bin/docker-compose
  • 测试Docker是否正确安装
$ docker-compose --version

docker-compose version 1.27.4, build 40524192

若能正常输出以上信息,则说明安装成功。

页: 1 2 3 4 5 6 7