
The main strength of inspect comes from its formatting capabilities.įor example, you can extract the IP address of a running container by inspecting it, and formatting in a specific way. To build a Docker image, run: docker build -t my:tag -f cmd/shfmt/Dockerfile.

The images only include shfmt -alpine variants exist on Alpine Linux. In case you were wondering, Docker objects or resources are simply things like containers, volumes, networks etc. The latest stable release is currently published as v3, and the latest development version as latest.
#Docker inspect format string how to
It lets you extract information about various docker objects, knowing how to use it is something EVERYONE should know about.
#Docker inspect format string code
Docker helps you ship code faster, test faster, deploy faster, and shorten the cycle between writing code and running code. With Docker, you can separate your applications from your infrastructure and treat your infrastructure like a managed application. All of these examples use the docker inspect command, but many other CLI commands have. Docker is an open platform for developing, shipping, and running applications.


By default, this command renders all results in a JSON object. Docker itself stores logs as JSON files therefore, its optimized to. One of the essential Docker commands is docker inspect. Docker provides a set of basic functions to manipulate template elements. Display detailed information on one or more networks Options: -f, -format string Format the output using the given go template -help Print usage Returns information about one or more networks. Usage: docker container inspect OPTIONS CONTAINER CONTAINER. Docker supports the JSON logging format, and logging data in this format is recommended.
