Open dj-wasabi opened 8 years ago
You would probably have to make sure whatever networking model is being used will work with the expectations of the driver. The driver tries to SSH to $DOCKER_IP:$MAPPED_PORT
where the DOCKER_IP is probably localhost in this case. The mapped port would only be valid on the hypervisor though. In this case you probably want to skip the port mapping and talk directly to the container's IP, but there is not currently any code for that.
Why not to make it simple as in proposed https://github.com/test-kitchen/kitchen-docker/pull/203 ?
@ytsarev The issue with that approach is the IP of the hypervisor needs to be fixed or you're going to have a hellacious kitchen config.
@coderanger not sure if I understood you correctly but in my case it's not IP of the hypervisor as it is but more or less standard IP of docker0 bridge. Which is pretty generic.
@ytsarev That very much depends on the kind of networking model you are using. If a static, hardwired address works for you then that's cool, but I wouldn't advertise it as a generic solution.
@coderanger I agree, but at least the bridge model is default
Running into this same issue myself. Last post on this thread is pretty old. Anyone found any good solutions to this problem?
I would highly recommend using kitchen-dokken
if possible to people in this situation. It doesn't use SSH so it doesn't have as many issues with networking management.
@coderanger thank you for the recommendation. Project looks interesting. However, looks pretty Chef specific. I'm using kitchen-docker with the kitchen-ansible provisioner. My first impressions make me think I can't do the same with kitchen-dokken.
Yeah, dokken is Chef-only at this time.
@coderanger to @ytsarev's point I could probably make this work if I could change the host and/or port used when making the SSH connection.
Hello 👋
I was having this issue too so I made this PR - https://github.com/test-kitchen/kitchen-docker/pull/283
If you get a chance to try it out, let me know if it also works for you. You'll need to add use_internal_docker_network: true
to your .kitchen.yml
file under the driver
section
@AaronKalair your patch worked for me. Nice solution IMO and dynamic enough to work in quite a few scenarios I would say.
Hi,
We have a Jenkins master running in docker. When a job is started, a jenkins-slave docker container is started and executes everything related in this job in this specific jenkins-slave container.
When running the
kitchen converge
step, it will create and boot a new docker container, but it can't login:I can see that the docker container is started and I can manually from my host login into the container. But It won't work from this jenkins-slave.
This is my .kitchen.yml file:
Versions: test-kitchen: 1.9.0 kitchen-docker: 2.4.0 kitchen-ansible: 0.43.1
Any suggestions where I should look at to make this work? Or do you need some more information?