Skip to content

Docker:Inspect

Return low-level information on Docker objects

실행된 컨테이너의 마운트 정보 확인 방법

docker inspect 9db6be68027d | jq .[0].Mounts

다음과 같이 출력된다:

[
  {
    "Type": "bind",
    "Source": "/media/user/Data/.steel",
    "Destination": "/Data/.steel",
    "Mode": "rw",
    "RW": true,
    "Propagation": "rprivate"
  }
]

실행된 컨테이너의 설정 정보 확인 방법

노출된 포트 (ExposedPorts), 환경변수 (Env), 시작 명령 (Entrypoint), 라벨 (Labels) 등 확인 가능.

docker inspect 9db6be68027d | jq .[0].Config

다음과 같이 출력된다:

{
  "Hostname": "9db6be68027d",
  "Domainname": "",
  "User": "",
  "AttachStdin": false,
  "AttachStdout": false,
  "AttachStderr": false,
  "ExposedPorts": {
    "8000/tcp": {}
  },
  "Tty": false,
  "OpenStdin": false,
  "StdinOnce": false,
  "Env": [
    "STEEL_DB_HOST=222.96.245.54",
    "STEEL_DB_PORT=3306",
    "STEEL_FILESERVICE_HOST=192.168.0.21",
    "STEEL_FILESERVICE_PORT=12000",
    "STEEL_ROOT_PATH=/Data/.steel",
    "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "LANG=C.UTF-8",
    "GPG_KEY=E3FF2839C048B25C084DEBE9B26995E310250568",
    "PYTHON_VERSION=3.9.17",
    "PYTHON_PIP_VERSION=23.0.1",
    "PYTHON_SETUPTOOLS_VERSION=58.1.0",
    "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/0d8570dc44796f4369b652222cf176b3db6ac70e/public/get-pip.py",
    "PYTHON_GET_PIP_SHA256=96461deced5c2a487ddc65207ec5a9cffeca0d34e7af7ea1afc470ff0d746207",
    "TZ=Asia/Seoul",
    "STEEL_ROOT=/steel",
    "PYTHONPATH=/steel",
    "PYTHONUNBUFFERED=1"
  ],
  "Cmd": null,
  "Image": "steel-kisco-inspect/api:0.0.1-kisco",
  "Volumes": {
    "/Data/.steel": {}
  },
  "WorkingDir": "/steel",
  "Entrypoint": [
    "gunicorn",
    "-w",
    "20",
    "-b",
    "0.0.0.0:8000",
    "-t",
    "7200",
    "api.api_main:app"
  ],
  "OnBuild": null,
  "Labels": {
    "com.docker.compose.config-hash": "10e939733f2de083861c2e68b555fe94dda9e850fec16653c1795e583eed6f7b",
    "com.docker.compose.container-number": "1",
    "com.docker.compose.oneoff": "False",
    "com.docker.compose.project": "kisco-answersteelscrapinspection",
    "com.docker.compose.project.config_files": "docker-compose.yml",
    "com.docker.compose.project.working_dir": "/home/bogonets/Project/steel/kisco-answersteelscrapinspection",
    "com.docker.compose.service": "api",
    "com.docker.compose.version": "1.27.4"
  }
}

See also