Skip to content

rbdiang/docker-secrets-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-secrets-example

This trivial example allows for passing secret to service

Steps followed for this example

  1. Initialize swarm cluster:
    docker swarm init
  2. Create secret greeting:
    echo "Hello, " | docker secret create greeting -
  3. Build image:
    docker build . -t simple
  4. Run stack service:
    docker stack deploy -c docker-compose.yml simple-stack
  5. View logs on running container:
    docker logs $(docker ps | grep simple | awk '{print $1}')

Expected output:

Output:

Here is the secret greeting: for Brian
Hello, Brian

Credit:

Credit for this implementation comes from this gist

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages