LoginSignup
7

More than 3 years have passed since last update.

Docker inspectでのWORKDIRやENTRYPOINT取得

Last updated at Posted at 2016-08-24

docker inspect-fオプション指定すればOKだけど、毎回忘れて調べてるからコピペ用にメモ。

WORKDIR取得

docker inspect -f "{{ .Config.WorkingDir  }}" your-image

ENTRYPOINT取得

docker inspect -f "{{ .Config.Entrypoint  }}" your-image

EXPOSE取得

docker inspect -f '{{ range $k,$v := .Config.ExposedPorts }}{{ println $k}}{{end}}' your-image

Author取得

docker inspect -f "{{ .Author  }}" your-image

Labels取得

以下のようにDockerfileでLABELが指定された場合

FROM alpine:latest
LABEL multi.label1="value1" multi.label2="value2" other="value3"

{{ index .Config.Label ラベルのキー }}という書式で取得します。

docker inspect -f '{{ index .Config.Labels "multi.label1"  }}' your-image

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7