What is the purpose of the '-f' flag in the 'docker inspect' command?

0248

The -f flag in the docker inspect command is used to format the output using a Go template. This allows you to specify which fields you want to display and how you want them to be presented. For example, you can extract specific information about a container or image in a more readable format.

Here’s an example of how to use the -f flag:

docker inspect -f '{{.Name}}' my-container

This command will output the name of the container named my-container. You can customize the template to retrieve various attributes as needed.

0 Comments

no data
Be the first to share your comment!