79142849

Date: 2024-10-30 21:33:50
Score: 0.5
Natty:
Report link

The problem that is not explained enough is that the secrets scope starts and ends within the run command. So in order to make them a permanent config, you need to save them as a temp file and copy them in your destination:


RUN --mount=type=secret,id=config,target=<DISK_CONFIG> \
    --mount=type=secret,id=credentials,target=<DISC_CREDENTIALS> \
    cp <TEMP_CONFIG> <PERMANENT_CONFIG_LOCATION> && cp <TEMP_CREDENTIALS> <PERMANENT_CREDENTIALS_LOCATION>

Feel free to add a cleaner syntax.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Andy95