简体   繁体   English

Habor 安装程序认为 docker-compose 没有安装

[英]Habor installer thinks docker-compose is not installed

I m trying to install Harbor 2.4.1 on a CentOS 7 host.我正在尝试在 CentOS 7 主机上安装 Harbor 2.4.1。 I have already installed docker and docker-compose.我已经安装了 docker 和 docker-compose。 But wenn I try to run./install.sh to instal harbor I get the message但是我尝试运行./install.sh 来安装港口我收到消息

[grafra1969@docker-registry harbor]$ sudo ./install.sh --with-notary --with-trivy --with-chartmuseum

[Step 0]: checking if docker is installed ...

Note: docker version: 20.10.12

[Step 1]: checking docker-compose is installed ...
✖ Need to install docker-compose(1.18.0+) by yourself first and run this script again.
[grafra1969@docker-registry harbor]$ ls ..
certs  harbor  harbor-online-installer-v2.4.1.tgz  harbor-online-installer-v2.4.1.tgz.asc

Docker and docker-compose are available. Docker 和 docker-compose 可用。 What is the problem?问题是什么?

[grafra1969@docker-registry harbor]$ docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:41 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:44:05 2021
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[grafra1969@docker-registry harbor]$

this is a bug/issue with the composer installation, I just had the same problem and managed to fix it by running:这是作曲家安装的一个错误/问题,我刚刚遇到了同样的问题并设法通过运行来修复它:

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

and then to prevent the installer from overwriting the symlink you just created you will need to remove the docker and docker-compose installation from the installer.然后为了防止安装程序覆盖您刚刚创建的符号链接,您需要从安装程序中删除 docker 和 docker-compose 安装。

You should have a sh file that looks something like this:你应该有一个看起来像这样的 sh 文件:

#!/bin/bash

#Harbor on Ubuntu 18.04

#Prompt for the user to ask if the install should use the IP Address or Fully Qualified Domain Name of the Harbor Server
PS3='Would you like to install Harbor based on IP or FQDN? '
select option in IP FQDN
do
    case $option in
        IP)
            IPorFQDN=$(hostname -I|cut -d" " -f 1)
            break;;
        FQDN)
            IPorFQDN=$(hostname -f)
            break;;
     esac
done

# Housekeeping
apt update -y
swapoff --all
sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
ufw disable #Do Not Do This In Production
echo "Housekeeping done"

#Install Latest Stable Harbor Release
HARBORVERSION=$(curl -s https://github.com/goharbor/harbor/releases/latest/download 2>&1 | grep -Po [0-9]+\.[0-9]+\.[0-9]+)
curl -s https://api.github.com/repos/goharbor/harbor/releases/latest | grep browser_download_url | grep online | cut -d '"' -f 4 | wget -qi -
tar xvf harbor-online-installer-v$HARBORVERSION.tgz
cd harbor
sed -i "s/reg.mydomain.com/$IPorFQDN/g" harbor.yml
./install.sh --with-clair --with-chartmuseum
echo -e "Harbor Installation Complete \n\nPlease log out and log in or run the command 'newgrp docker' to use Docker without sudo\n\nLogin to your harbor instance:\n docker login -u admin -p Harbor12345 $IPorFQDN"

After all of this you can check if you have docker and docker-compose installed by running them with no commands and if they are indeed installed you can now run the new installer sh file.在所有这些之后,您可以通过不使用命令运行它们来检查您是否安装了 docker 和 docker-compose,如果确实安装了它们,您现在可以运行新的安装程序 sh 文件。

Also, add yourself to the docker group using sudo usermod -a -G docker <YOUR_USER> just to make sure that's not the issue.此外,使用sudo usermod -a -G docker <YOUR_USER>将自己添加到 docker 组,以确保这不是问题。

For more info on this problem check Github有关此问题的更多信息,请查看Github

My Problem was caused by the fact that I installed docker-compose in /usr/local/bin.我的问题是由于我在 /usr/local/bin 中安装了 docker-compose 引起的。 I assumed this would be a good location, since it was in the PATH of my user and in the PATH of user root.我认为这将是一个很好的位置,因为它在我的用户的 PATH 和用户 root 的 PATH 中。 However I did not consider, that sudo uses a different PATH.但是我没有考虑到,sudo 使用了不同的 PATH。 This secure path is configured in /etc/sudoers and does not contain /usr/local/bin.此安全路径在 /etc/sudoers 中配置,不包含 /usr/local/bin。 So I deceided to move the docker-compose script to /usr/bin and the installer worded fine.所以我决定将 docker-compose 脚本移动到 /usr/bin 并且安装程序的措辞很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何离线安装docker-compose? - How to install docker-compose offline? Docker 桌面安装程序不启动 - Docker Desktop Installer does not start NSIS安装程序访问引擎检查是否已安装 - NSIS installer access engine check if installed 在 docker windows/servercore 中运行有人值守的安装程序 - Running attended installer inside docker windows/servercore 如何为 docker 和 electron 一起创建安装程序? - How to create installer for docker and electron together? Windows 安装程序必须写入注册表(与 NSIS 一起安装的编译的 python 应用程序) - It is necessary for a windows installer to write to registary (compiled python app installed with NSIS) 如何从android安装程序获得响应(apk是否安装成功)? - How to get response from android installer (whether the apk is installed successfully or not)? 使用 Eclipse 安装程序安装的 Eclipse (Mars 4.5.1) 无法识别新插件 - Eclipse (Mars 4.5.1) installed with the Eclipse Installer does not recognize new plugin Android 系统安装程序应用程序“未安装应用程序”为什么? 这个日志在哪里? - Android System Installer App "Application Not Installed" why? where is log for this? Inno Setup:如何将安装程序本身放入已安装的程序中 - Inno Setup: How to put the installer itself in the installed program
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM