CircleCI
docker

CircleCI2にsshした時にDockerデーモンと通信できない時

こんなの

# 接続
ssh -p 32768 x.x.x.x    
# ...
docker ps
# Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

docker-compose ps
# ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

# If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

解決

DockerとかDockerComposeを使う時のsetup_remote_docker実行された後に、sshすると治ります。

これ!!!!

config_yml_—____work_repository_amskai.png

CircleCI_🔊.png

この後に再度ログイン。

exit
# Connection to x.x.x.x closed.
ssh -p 32768 x.x.x.x
# ...                                                                                                                                                                                  
docker ps
# CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS              NAMES
# 34751fa806fe        mysql               "docker-entrypoint..."   5 minutes ago       Up 5 minutes        3306/tcp            db
docker-compose ps
# Name              Command                State      Ports   
# -----------------------------------------------------------           
# db     docker-entrypoint.sh mysqld      Up         3306/tcp 

よく分かってないけど、とりあえずstepup_remote_dockersteps:の頭の方に置いたほうがいいかもですね。