docker-compose安装部署

文章目录

  • 直接安装
  • 一、从github上下载docker-compose二进制文件安装
  • 二、加权限以及查看版本
    • ok了!!!


直接安装

一、从github上下载docker-compose二进制文件安装

sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

若是github访问太慢,可以用daocloud下载

sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

重点!:如果在 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

你可能感兴趣的:(docker,docker,容器,linux)