How to docker inspect inside the container?

docker

#1

Hello,

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

jobs:
  build:
    docker:
      - image: docker:stable-dind

    steps:
      - 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”

Thanks,


#2

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


#3

I use docker inspect instead of docker cp.

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

Thanks a lot!.


#4

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.


#5

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