podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

Support ssh key in building images

Open dfn-certling opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. podman-compose does not seem to support the ssh key as part of the build specification for images (https://github.com/compose-spec/compose-spec/blob/master/build.md#ssh).

Describe the solution you'd like Supporting the ssh key should boil down to an addition to build_one along the lines of

    for agent_or_key in build_desc.get("ssh", []):
        build_args.extend(["--ssh", agent_or_key])

That should extend the arguments provided to podman build to include the proper key or agent socket. I can prepare a pull request if this is interesting.

Describe alternatives you've considered It is possible to provide keys on a global level by adding something like --podman-build-args \\--ssh=default, but that needs to be added explicitly and does not easily allow to use different keys or agents for different images.

dfn-certling avatar Jun 08 '23 14:06 dfn-certling

I second this. I haven't found a way to build the way I want without this feature, so I've had to use docker compose.

2ToTheNthPower avatar Dec 26 '23 18:12 2ToTheNthPower

I also believe that this should be available without workarounds. However, if you need just single agent, you can use what dfn-certling has already suggested: --podman-build-args \\--ssh=default

mladedav avatar Feb 21 '24 13:02 mladedav