ubuntu 离线安装docker + docker-compo
2021-10-14 本文已影响0人
fatshi
安装docker
- 查看ubuntu版本
ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
- 下载对应版本的deb文件,这里需要下载如下载如下文件:
https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/
docker-ce-cli_18.09.6~3-0~ubuntu-bionic_amd64.deb
containerd.io_1.2.5-1_amd64.deb
docker-ce_18.09.6~3-0~ubuntu-bionic_amd64.deb
- 顺序安装上述文件,先安装 containerd.io 跟 docker-ce-cli,最后安装docker-ce
sudo dpkg -i xxxx.deb
安装docker-compose
- 下载docker-compose
# 通常下载的是docker-compose-Linux-x86_64
https://github.com/docker/compose/releases
- 将下载的compose文件 "docker-compose-Linux-x86_64“ 改名为 “docker-compose”,移动到 /usr/local/bin,并添加可执行权限
sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose