skip to Main Content

I m trying to install Harbor 2.4.1 on a CentOS 7 host.
I have already installed docker and docker-compose.
But wenn I try to run ./install.sh to instal harbor I get the message

[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. 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]$

2

Answers


  1. Chosen as BEST ANSWER

    My Problem was caused by the fact that I installed docker-compose in /usr/local/bin. I assumed this would be a good location, since it was in the PATH of my user and in the PATH of user root. However I did not consider, that sudo uses a different PATH. This secure path is configured in /etc/sudoers and does not contain /usr/local/bin. So I deceided to move the docker-compose script to /usr/bin and the installer worded fine.


  2. 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.

    You should have a sh file that looks something like this:

    #!/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 '/sswaps/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 nnPlease log out and log in or run the command 'newgrp docker' to use Docker without sudonnLogin 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.

    Also, add yourself to the docker group using sudo usermod -a -G docker <YOUR_USER> just to make sure that’s not the issue.

    For more info on this problem check Github

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search