hercules-ci / arion

Run docker-compose with help from Nix/NixOS
Apache License 2.0
670 stars 48 forks source link

add support for docker compose secrets #255

Open KiaraGrouwstra opened 3 months ago

KiaraGrouwstra commented 3 months ago

enables using docker compose secrets from arion, which includes:

unlike #52, i did not so far add support for their long syntax, which despite the confusing documentation appears limited to Docker Swarm, in my understanding currently limiting its use in Arion.

KiaraGrouwstra commented 3 months ago

to make the support for build secrets in the compose file more useful, i'm still trying to figure out how to pass those secret mounts to dockerTools' build steps. those are confusing me a bit right now, as generated images seem to just have a single step (Cmd running an init). if anyone here would have more of an idea on that, i'd be grateful.

edit: i'm now under the impression the actual nixos config is realized at run-time, meaning for nixos containers we would not currently be able to utilize build secrets' limited secret exposure

edit 2: i think we could set service.image.rawConfig.Run = ["--mount=type=secret,id=foo nixos-rebuild switch"];, but even if that would work (which i'm not confident of), setting service.build.secrets with this PR seems to trigger an arion build error:

failed to solve: failed to read dockerfile: open /home/kiara/.local/share/docker/tmp/buildkit-mount3337376318/Dockerfile: no such file or directory

KiaraGrouwstra commented 3 months ago

given docker stack/swarm seems to support e.g. secrets' long-syntax (configure secret permissions/ownership) and external secrets i wonder, how have considerations been toward supporting that?

aacebedo commented 3 weeks ago

Is this stil under work? It would be extremely useful.

KiaraGrouwstra commented 3 weeks ago

@aacebedo i had not worked on this further, no