Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Cannot loop over files in /run/secrets in Docker

$
0
0

Is looping over files in /run/secrets forbidden in Docker; or perhaps, sh?

I am trying to do this in a script called by ENTRYPOINT:

#!/bin/sh…cd /run/secrets/usersls -l # A list of files, proving that the secrets are present, is output.for username in *; do      echo "username is «$username»" # But $username is empty here.done

The output of ls -l and echo is:

(container name)  | total 8(container name)  | -rw-r--r--    1 root     root             9 May 17 17:08 file1(container name)  | -rw-r--r--    1 root     root             5 May 17 17:08 file2(container name)  | username is «»
  • The docker image is built on alpine.
  • Docker version 26.1.3, build b72abbb.
  • Docker Compose version v2.27.0.

I was expecting that the variable username would contain the name of each file in /run/secrets/users.


Viewing all articles
Browse latest Browse all 12111

Trending Articles