卸载旧的版本
root@vultr:~# sudo apt-get remove docker docker-engine docker.io containerd runc
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'docker-engine' is not installed, so not removed
Package 'containerd' is not installed, so not removed
Package 'docker' is not installed, so not removed
Package 'runc' is not installed, so not removed
Package 'docker.io' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 55 not upgraded.
更新
root@vultr:~# sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu disco-security In Release [97.5 kB]
Hit:2 http://ppa.launchpad.net/certbot/certbot/ubuntu dis co InRelease
Hit:3 http://archive.ubuntu.com/ubuntu disco InRelease
Get:4 http://archive.ubuntu.com/ubuntu disco-updates InRe lease [97.5 kB]
Get:5 http://archive.ubuntu.com/ubuntu disco-backports In Release [88.8 kB]
Get:6 http://archive.ubuntu.com/ubuntu disco-updates/main i386 Packages [246 kB]
Get:7 http://archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages [301 kB]
Get:8 http://archive.ubuntu.com/ubuntu disco-updates/univ erse i386 Packages [310 kB]
Get:9 http://archive.ubuntu.com/ubuntu disco-updates/univ erse amd64 Packages [316 kB]
Fetched 1,457 kB in 3s (551 kB/s)
Reading package lists... Done
允许apt通过https安装软件
## apt install mono-devel
root@vultr:~# sudo apt-get install \
> apt-transport-https \
> ca-certificates \
> curl \
> gnupg2 \
> software-properties-common
# Updating from such a repository can't be done securely, and is therefore disabled by default.
# -- allow-unauthenticated
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20190110).
software-properties-common is already the newest version (0.97.11).
The following additional packages will be installed:
libcurl4
The following NEW packages will be installed:
apt-transport-https gnupg2
The following packages will be upgraded:
curl libcurl4
2 upgraded, 2 newly installed, 0 to remove and 53 not upgraded.
Need to get 405 kB of archives.
After this operation, 205 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
安装docker官方GCP key
root@vultr:~# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
安装docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
安装dock-compose
$ apt install docker-compose
# docker-compose --version
Reading package lists... Done
Building dependency tree
Reading state information..
下载yml
root@vultr:~# wget https://raw.githubusercontent.com/ihciah/rabbit-tcp/master/docker-compose-server.yml
--2019-10-18 09:57:48-- https://raw.githubusercontent.com/ihciah/rabbit-tcp/master/docker-compose-server.yml
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.232.36.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.36.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 175 [text/plain]
Saving to: ‘docker-compose-server.yml’
docker-compose-server.yml 100%[===============================================>] 175 --.-KB/s in 0s
2019-10-18 09:57:48 (12.7 MB/s) - ‘docker-compose-server.yml’ saved [175/175]
nano docker-compose-server.yml
rabbit-server:
image: ihciah/rabbit
ports:
- "9800:9891/tcp"
environment:
- MODE=s
- PASSWORD=password
- RABBITADDR=:9891
- VERBOSE=2
restart: always
运行
root@vultr:~# docker-compose -f docker-compose-server.yml up -d
Pulling rabbit-server (ihciah/rabbit:)...
latest: Pulling from ihciah/rabbit
9d48c3bd43c5: Pull complete
0e415ec57a04: Pull complete
Digest: sha256:43c5106f5ce8d3cdbf66b7204ebcfb53b5cfb358c2883c44778c891bb80f3d48
Status: Downloaded newer image for ihciah/rabbit:latest
Creating root_rabbit-server_1 ... done
root@vultr:~# nano docker-compose-server.yml
客户端
PS C:\Windows\system32> choco install docker-desktop docker-compose wget -y
Chocolatey v0.10.15
Installing the following packages:
docker;docker-compose
By installing you accept licenses for the packages.
下载客户端配置
D:\rabbit-tcp>wget https://raw.githubusercontent.com/ihciah/rabbit-tcp/master/docker-compose-client.yml
--2019-10-18 10:14:51-- https://raw.githubusercontent.com/ihciah/rabbit-tcp/master/docker-compose-client.yml
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.76.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.76.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 257 [text/plain]
Saving to: 'docker-compose-client.yml'
docker-compose-client.yml 100%[=================================================>] 257 --.-KB/s in 0s
2019-10-18 10:14:53 (614 KB/s) - 'docker-compose-client.yml' saved [257/257]
D:\rabbit-tcp>