How to docker inspect inside the container?




I use docker image docker:stable-dind.
I want to run docker inspect inside the container.

By the way circleci local command is working docker inspect $HOSTNAME.

My config.yml is here.

version: 2

      - image: docker:stable-dind

      - checkout

      - setup_remote_docker

      - run:
          command: |
            docker version
            docker info

      - run:
          command: |
            docker inspect $HOSTNAME 

docker inspect got a error “Error: No such object: $HOSTNAME”



You can’t inspect the container from which you’re running commands.


I use docker inspect instead of docker cp.

Why can’t inspect the container? Is the security reason?

Thanks a lot!.


You don’t have access to the Docker engine running your base container. When you use setup_remote_docker, that is a new virtual machine running Docker with the socket shared with you via TCP.


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