Enable ssh option as build parameter for buildkit
Is your feature request related to a problem? Please describe. When building a container we need access to other Resources like ssh and dont want to expose a private key in the container.
Describe the solution you'd like
Support of --ssh in the build process that already works in buildkit.
Additional context
I tried 1.25.0-rc4, but it does not support --ssh option. Tried the same as in bug 6440:
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1
docker-compose build --ssh default my_image
This would be a major security improvement and save us so much pain.
Thanks, bert
tracked internally as https://docker.atlassian.net/browse/COMPOSE-107
Any timeline on this ?
🤔 any news team?
I saw that buildkit made its way into docker-compose, but ssh is not there yet. This feature would really help to make docker-compose an ideal team for large scale deployments and local developments in one tool.
I adopted this feature early and now I am having a maintenance nightmare.
@sajusat How did you adopt this feature? How's it going?
@jungwookim I kept the experimental meta tag in all the Dockerfiles and used --ssh option to do the builds. When I use these images I cannot used the --build option when there is a change in the dockerfile.
Any update on this? We resorted to using shell scripts for building, and then using docker compose to start everything.
Any update on this guys ?
It's been like two years since I am following this option. I have seen talks about should you guys implement it or not... Someone please say something concrete.
Any update on this?
I know it may not be the best place to ask nooby questions, but it kind of relates to the topic: What is a difference between 'docker compose' and 'docker-compose' ? Obviously 'compose' command is not documented anywhere. I ask, because for some reason I am able to build image which relies on ssh connection with 'docker compose', tho it expectedly fails with 'docker-compose'.
My use case is only for dev purposes and I am using Docker Desktop for Windows with WSL 2.
Edit: Ok, all it took is to read first outputline of the command: The new 'docker compose' command is currently experimental. To provide feedback or request new features please open issues at https://github.com/docker/compose-cli
Forgot to update with #7997 which I'm working on to support arbitrary arguments to help with this
+1. I am a regular Docker user working on an app with Docker and compose. I was glad to find out about the easy and secure way of using SSH in docker build --ssh default to give the build access to my SSH key to fetch private packages. “Cool”, I thought, “since it is so easy with docker build, I can do the same in my docker compose process too.” Which I apparently can’t yet due to this bug. I hope this will be available to compose.
+1
I would also love this to be a thing, or for the compose to be generally more transparent when sending information from or to the host.
+1
I would also greatly appreciate this feature!
Has anyone got some kind of workaround ? 🥺
Has anyone got some kind of workaround ? 🥺
Workaround is that you build the individual images yourself with docker build using the SSH options, and then after that do the compose.