Last active
December 13, 2022 10:38
-
-
Save barakplasma/a2e9d79ffdfcffc3048d68c01ecd7fe7 to your computer and use it in GitHub Desktop.
How to read docker-compose secrets file as environment variables from unadapted image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
read_secret_simple: | |
build: . | |
secrets: | |
- my_secret | |
read_secret_existing_image: | |
image: registry | |
entrypoint: [ "sh", "/run/secrets/my_secret2" ] | |
secrets: | |
- my_secret2 | |
secrets: | |
my_secret: | |
file: ./my_secret.sh | |
my_secret2: | |
file: ./my_secret2.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox | |
CMD [ "sh", "/run/secrets/my_secret" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export MY_SECRET=GERBILS | |
printenv | |
# use normal entrypoint from default docker | |
date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export MY_SECRET=GERBILS | |
export REGISTRY_HTTP_SECRET=2GERBILS | |
printenv | |
# use normal entrypoint from default docker | |
/entrypoint.sh /etc/docker/registry/config.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment