Bootstrap FreeKB - Docker - docker secret inspect command
Docker - docker secret inspect command

Updated:   |  Docker articles

A secret is a file that contains sensitive data, such as a password.

Let's say the docker secret ls command returns the following.

ID                          NAME               DRIVER        CREATED             UPDATED
pp6d206pqk28cj12kjv36l2v7   my_secret                        14 months ago       14 months ago
g6ab3l6qr9w5lt8puu3f971f5   foobar                           7 months ago        7 months ago
oxp56zzcssvptzdk214qv22l5   another_example                  5 months ago        5 months ago

 

The docker secret inspect command can be used to view a secret. In this example, the secret with ID pp6d206pqk28cj12kjv36l2v7 is inspected.

docker secret inspect pp6d206pqk28cj12kjv36l2v7

 

In this example, the secret named my_secret is inspected.

docker secret inspect my_secret

 

If the secret exists, something like this will be displayed.

{
 "ID":"pp6d206pqk28cj12kjv36l2v7 "
 "Version":{
            "Index":16114223
           }
 "CreatedAt":"2019-03-11T18:16:09.317112631Z"
 "UpdatedAt":"2019-03-11T18:16:09.317112631Z"
 "Spec":{
         "Name":"my_secret"
         "Labels":{}
        }
}

 

If the secret does not exist, the following will be returned.

Status: Error: No such secret: my_secret, Code: 1

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 18a69a in the box below so that we can be sure you are a human.