Execute docker commands when rerunning job with ssh?

Given the following job config:

version: 2.1
jobs:
  example:
    docker:
      image: docker:18.09.0
    steps:
      - checkout
      - setup_remote_docker
      - run: docker build ...
      - run: docker run ...
      - run: docker exec ...

I would like to “Rerun job with SSH” and then manually debug the various docker steps. Currently, if I do that I get:

 docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

I understand that in normal operation, setup_remote_docker causes docker commands to be executed in the remote environment. Is there a way to have that still work when SSH’ing into the job?

Hi,

Yes, it should be possible to access the remote Docker environment in your SSH session. To ensure that, you can set the --tlsverify, -H, --tlscacert, --tlscert and --tlskey options when running docker, using the DOCKER_CERT_PATH and DOCKER_HOST information output in the “Setup a remote Docker engine” step.

For more information, you can refer to our Support Center article here: https://support.circleci.com/hc/en-us/articles/360010223434

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.