compose icon indicating copy to clipboard operation
compose copied to clipboard

Enable ssh option as build parameter for buildkit

Open bert2002 opened this issue 7 years ago • 39 comments

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

bert2002 avatar Nov 18 '19 06:11 bert2002

tracked internally as https://docker.atlassian.net/browse/COMPOSE-107

ndeloof avatar Nov 20 '19 08:11 ndeloof

Any timeline on this ?

sajusat avatar Dec 08 '19 18:12 sajusat

🤔 any news team?

jufemaiz avatar Jul 13 '20 02:07 jufemaiz

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.

bert2002 avatar Jul 16 '20 07:07 bert2002

I adopted this feature early and now I am having a maintenance nightmare.

sajusat avatar Jul 24 '20 16:07 sajusat

@sajusat How did you adopt this feature? How's it going?

jungwookim avatar Jul 25 '20 02:07 jungwookim

@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.

sajusat avatar Jul 26 '20 19:07 sajusat

Any update on this? We resorted to using shell scripts for building, and then using docker compose to start everything.

alechirsch avatar Sep 24 '20 15:09 alechirsch

Any update on this guys ?

AdemUstaReminiz avatar Oct 15 '20 13:10 AdemUstaReminiz

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.

sajusat avatar Oct 28 '20 14:10 sajusat

Any update on this?

ChosunOne avatar Jan 20 '21 03:01 ChosunOne

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

dominik-stronk avatar Feb 01 '21 11:02 dominik-stronk

Forgot to update with #7997 which I'm working on to support arbitrary arguments to help with this

zoonage avatar Feb 08 '21 13:02 zoonage

+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.

jaanus avatar Jul 09 '21 09:07 jaanus

+1

davide-c avatar Oct 05 '21 19:10 davide-c

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.

ekampp avatar Oct 07 '21 07:10 ekampp

+1

username7171 avatar Nov 16 '21 01:11 username7171

I would also greatly appreciate this feature!

AnticliMaxtic avatar Nov 19 '21 16:11 AnticliMaxtic

Has anyone got some kind of workaround ? 🥺

GabrielPsantos avatar Nov 26 '21 13:11 GabrielPsantos

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.

jaanus avatar Nov 26 '21 14:11 jaanus