直接安装
一、从github上下载docker-compose二进制文件安装
若是github访问太慢,可以用daocloud下载
重点!:如果在 ubuntu 上面安装报错了
/usr/local/bin/docker-compose: line 1: {error:Document not found}: command not found
则使用此方法:
sudo apt install docker-compose
二、加权限以及查看版本
增加权限
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
docker-compose version 1.16.1, build 1719ceb
ok了!!!
1.如果uubuntu系统遇到下载docker-compose失败,则手动下载把docker-compose安装包放到/usr/local/bin/这下面
2.sudo docker-compose up -d下载失败的话:报错:Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting
答:修改docker下载源:
添加下面这个:
{
“runtimes”: {
“nvidia”: {
“path”: “nvidia-container-runtime”,
“runtimeArgs”: []
}
},
“registry-mirrors”: [
“https://6kx4zyno.mirror.aliyuncs.com”
],
“default-runtime”: “nvidia”,
“insecure-registries”: [“harbor.com”,“192.168.1.87:9500”],
“exec-opts”: [ “native.cgroupdriver=systemd” ]
}
下面是我们服务器的:
{
“runtimes”: {
“nvidia”: {
“path”: “nvidia-container-runtime”,
“runtimeArgs”: []
}
},
“registry-mirrors”: [
“https://dockerhub.azk8s.cn”,
“https://reg-mirror.qiniu.com”,
“https://quay-mirror.qiniu.com”
],
“default-runtime”: “nvidia”,
“insecure-registries”: [“harbor.com”,“192.168.1.87:9500”],
“exec-opts”: [ “native.cgroupdriver=systemd” ]
}
3.出现openjdk8下载不下来的话,手动拉 docker pull openjdk:8