Image and Container Metadata

From NovaOrdis Knowledge Base
Revision as of 18:23, 5 December 2017 by Ovidiu (talk | contribs) (→‎State)
Jump to navigation Jump to search

Internal

Overview

Generated with docker inspect, in the form of a JSON array.

The metadata has different semantics whether it was generated for an image or a container, as described below. Metadata for containers must provide all of the runtime configurations needed to start and restart the image with all of its settings intact.

Elements

Id

For images, the unique identifier of the images.

For containers, the unique identifier of the container.

"Id": "sha256:6902f4d604b94bddc603cba267ac61fb86c7602d121fa7cdd0c1f2526897a32e"

Parent

For images, the identifier of the parent image. Containers do not have parents.

RepoTags

"RepoTags": [ "registry.access.redhat.com/rhscl/postgresql-95-rhel7:latest" ]

RepoDigests

"RepoDigests": [ "registry.access.redhat.com/rhscl/postgresql-95-rhel7@sha256:33888776920331bc37ae17692bac043210305aa35ed444cf5eded89f8311d0d7"  ]

Comment

Created

"Created": "2017-11-22T15:23:09.730226Z"

Container

For an image, it may contain the identifier of the temporary container created when the image was built. Docker will create a container during the image construction process, and its identifier will be stored in the image metadata.

ContainerConfig

For an image, it refers to the temporary container created when the docker build command was executed.

Hostname

Domainname

User

AttachStdin

AttachStdout

AttachStderr

ExposedPorts

Tty

OpenStdin

StdinOnce

Env

Cmd

ArgsEscaped

Image

Volumes

WorkingDir

Entrypoint

OnBuild

Labels

DockerVersion

For an image, it contains the version of Docker used to create the image.

Author

Config

Hostname

Domainname

User

AttachStdin

AttachStdout

AttachStderr

ExposedPorts

Tty

OpenStdin

StdinOnce

Env

Cmd

ArgsEscaped

Image

Volumes

WorkingDir

Entrypoint

OnBuild

Labels

Architecture

Os

Size

VirtualSize

For an image, the size of the image in bytes.

GraphDriver

RootFS

Type

"Type": "layers"

Layers

[
  "sha256:e1d829eddb62dc49f1c56dbf8acd0c71299b3996115399de853a9d66d81b822f",
  "sha256:02404b4d7e5d89b1383ca346b4462b199128aa4b238c5a2b2c186004ac148ba8",
  "sha256:808f296bc8ac99056e0cbba79e2b253fff2c3c963927be1a9acd182bbc90538e"
]

State

It only shows for containers. It contains various status flags and the process id for the container.

Image

It only shows for containers. It contains the Id of the image this container is running.

NetworkSettings

It only shows for containers. It contains the network environment for the container.

LogPath

It only shows for containers. It contains the system path to this container's log file.

RestartCount

It only shows for containers. It keeps track of the number of times the container has been restarted.

Name

It only shows for containers. It contains the user defined name for the container.

Volumes

It only shows for containers. It defines the volume mapping between the host system and the container.

HostConfig

It only shows for containers. It contains configuration for how the container will interact with the host system. Includes CPU and memory limits, networking values, or device driver paths.