Comments (11)
% kitchen version
Test Kitchen version 1.3.1
from kitchen-docker.
While kitchen converge
is waiting, if I do this in another terminal, it recovers and continues quickly:
% docker exec 758a5f693186 /etc/init.d/ssh start
* Starting OpenBSD Secure Shell server sshd
...done.
from kitchen-docker.
I may be a bit lost also. In an effort to try and reproduce this reliably, I destroyed all containers and images (docker rm + rmi). kitchen converge default-ubuntu-1404
now fails differently, and earlier:
% kitchen converge default-ubuntu-1404
-----> Starting Kitchen (v1.3.1)
-----> Converging <default-ubuntu-1404>...
Preparing files for transfer
Preparing dna.json
Berksfile, Cheffile, cookbooks/, or metadata.rb not found so Chef will run with effectively no cookbooks. Is this intended?
Removing non-cookbook files before transfer
Preparing solo.rb
[SSH] connection failed, retrying (#<Errno::ECONNREFUSED: Connection refused - connect(2) for "192.168.59.103" port 49168>)
[SSH] connection failed, retrying (#<Errno::ECONNREFUSED: Connection refused - connect(2) for "192.168.59.103" port 49168>)
$$$$$$ [SSH] connection failed, terminating (#<Errno::ECONNREFUSED: Connection refused - connect(2) for "192.168.59.103" port 49168>)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #converge action: [Connection refused - connect(2) for "192.168.59.103" port 49168]
from kitchen-docker.
It is because you are overriding the run command so the sshd deamon is not running.
The driver sets its own run_command:
https://github.com/portertech/kitchen-docker/blob/master/lib/kitchen/driver/docker.rb#L36
You should not really rely on /sbin/init when using Docker containers. If you really do need to start services then consider supervise, but from experience I'd not go down that route.
from kitchen-docker.
You should not really rely on /sbin/init when using Docker containers
Predictably, I expected this response. My particular endeavor requires a real init system to test against. If you need context, see https://github.com/jordansissel/pleaserun.
Any recommendations on having kitchen-docker running init and also starting sshd? Custom Dockerfile per machine? Any prior art in this area?
from kitchen-docker.
One of the key ideas around using Docker is to run single process in their own container and then linking them together (if required). From memory, Docker actually replaces /sbin/init with their own version.
Even when running init, Docker does things behind the scene that means services are not started automatically, you need to each one manually. I went through the pain of discovering that 6 months ago.
One option is to use supervisor which is the recommend approach from the Docker team if you do actually need more than one service running.
The other option would perhaps try the driver https://github.com/marcy-terui/kitchen-docker_cli as it uses docker exec to copy stuff across instead of ssh/scp. Still not sure it will work though, as you would still have to start the services manually.
Looking at the project you have, maybe you have to add support for supervise when running in a Docker container? Or a helper that works out what services to start?
from kitchen-docker.
@peterabbott you are really not understanding what I am asking. "Use supervisord" is a solution to a problem I do not have. I am not asking for a lesson on what you believe Docker to be for.
This kind of "Let me tell you how I use Docker, and therefore your way is wrong" is the same noise I get nearly every time I ask questions near the Docker community.
I'm out.
from kitchen-docker.
Then I guess Docker is the wrong tool for the problem you are trying to solve.
If the Docker team are suggest you to use supervisord then using anything else is probably just going to be waisting your time.
I was in the same spot you were a few months ago, trying to get upstart working. I just didn't work in the way we would expect in other setups. You can't get passed the fact that Docker containers will not automatically start services using upstart/init.d etc.
Running manually like this will work though, but is still a bit annoying to manage:
docker run -it ubuntu:14.04 bash -c "service sshd start && service httpd start && tail -f /var/log/apache2/stdout"
Was just trying to save you the pain of discovering what I went through trying to get init.d/upstart running automatically on Docker.
from kitchen-docker.
I'm in a situation similar to @jordansissel.
I'm using kitchen-docker because kitchen-vagrant (virtualbox) doesn't work on cloud CI systems, not because I want to use docker. I need to test a setup that uses SysV init. All of my ansible is failing because SSHD isn't running.
It would be nice if there was a way to make this work.
from kitchen-docker.
@aerickson Unfortunately this is a good example of how Docker is not the same as a tiny VM. It's close, but definitely not the same thing. SysV is functionally dead at this point so most effort is going to making systemd work well for testing, and even that is currently way harder than it should be with kitchen-docker. I would recommend using something like kitchen-ec2 or another cloud driver if you really do need true VMs.
from kitchen-docker.
Thanks. Realized my setup used Upstart and found this.
http://www.tddfellow.com/blog/2015/08/05/running-kitchen-docker-tests-with-upstart/
from kitchen-docker.
Related Issues (20)
- chef-client cookbook now fails with this driver HOT 1
- Transport does not work in Windows HOT 7
- Gem v2.9.0 doesn't include the docker transport HOT 6
- Unable to fetch packages during kitchen create for ubuntu-14.04 platform HOT 1
- Message: Error getting internal IP of Docker container HOT 4
- Docker images deletions fails when instances share the same image ID
- There does not appear to be a way to clean up volumes created by kitchen-docker HOT 4
- dependency roles in requirements.yml installed successfully, but error role not found when running test playbook. HOT 1
- Create new release of kitchen-docker gem HOT 5
- kitchen-docker 2.10.0 doesn't work, at least not docker-in-docker HOT 16
- This seems to be fixed, does it still need to be here?
- Unable to use docker as transport HOT 10
- docker build output no longer matches image_helper regex HOT 1
- Unable to map docker.sock in as volume for docker-in-docker HOT 2
- Cannot use docker transport when using docker tmpfs on /tmp
- Docker build on M1 Mac can fail if the buildkit output includes timings/timestamps HOT 8
- Support for Centosstream and PhotonOS missing from kitchen-docker HOT 1
- SSH failed with Ubuntu 22 and Centos 9 HOT 2
- Amazon 2022 images fail to build due to conflict between curl packages HOT 6
- Waiting for SSH service on localhost:49714, retrying in 3 seconds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitchen-docker.