Tag Archives: docker-compose

Docker-compose Run Error: Couldn’t connect to Docker daemon at http+docker://localhost – is it running?

The reason for this problem is the problem of user rights. There are two solutions

Switch to the root user to execute the commandsudo docker-compose up -d

Adds the current user to the docker group sudo gpasswd - a ${user} docker and then switch to root user, then switch to current user, and execute docker compose up - d again, there is no problem

➜  /usr/local/tidb-docker-compose git:(master) sudo gpasswd -a penelope docker
You are adding the user "penelope" to the "docker" group
➜ /usr/local/tidb-docker-compose git:(master) su - 
Password:
root@wjj-PC:~# su - penelope
➜  /home/penelope cd /usr/local/tidb-docker-compose 
➜  /usr/local/tidb-docker-compose git:(master) docker-compose up -d
Creating network "tidb-docker-compose_default" with the default driver
Creating tidb-docker-compose_prometheus_1_c5dcdc31242f          ... done
Creating tidb-docker-compose_pd0_1_76eba4089930                 ... done
Creating tidb-docker-compose_dashboard-installer_1_aacf66ea2abb ... done
Creating tidb-docker-compose_pd1_1_37f2e3342d08                 ... done
Creating tidb-docker-compose_pushgateway_1_6bdd0daf84ee         ... done
Creating tidb-docker-compose_pd2_1_8f3958f98cb1                 ... done
Creating tidb-docker-compose_grafana_1_b1171d4ef96c             ... done
Creating tidb-docker-compose_tidb-vision_1_1cfffb488802         ... done
Creating tidb-docker-compose_tikv2_1_e8dda83dee83               ... done
Creating tidb-docker-compose_tikv0_1_df5a641d13f5               ... done
Creating tidb-docker-compose_tikv1_1_7d2d291b11a7               ... done
Creating tidb-docker-compose_tispark-master_1_6d1132a4e105      ... done
Creating tidb-docker-compose_tidb_1_8c9570604565                ... done
Creating tidb-docker-compose_tispark-slave0_1_722ac312ba0e      ... done

[Solved] docker-compose:No module named ssl_match_hostname; ImportError: No module named shutil_get_te…

 

Reason for error, ssl_match_hostname not found

The online solution is: pip install –upgrade backports.ssl_match_hostname
It doesn’t actually work, it prompts that the module is already installed in /usr/local/lib/python2.7/dist-packages

root@kali~:#pip2 install –upgrade backports.ssl_match_hostname
Requirement already up-to-date:
backports.ssl_match_hostname in /usr/local/lib/python2.7/dist-packages (3.7.0.1)

Uninstalling and reinstalling docker-compose, emmmm, is also useless.

The final cause of the problem is:

**/usr/local/lib/python2.7/distpackages/docker/transport/ssladapter.py **
I can’t find the ssl_match_hostname module in the backports package under the package path.
In that case, let the script be able to find that module.

Final solution:

Method 1: Copy the module to the package path [Success].

#Go to the backports module path
cd /usr/local/lib/python2.7/dist-packages
#Copy the entire package to the transport package path
cp -r backports /usr/local/lib/python2.7/dist-packages/docker/transport

Problem 2

ImportError: No module named shutil_get_terminal_size

Solution

sudo apt install ipython

View version

sudo docker-compose version