Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default command is /usr/sbin/sshd -D #105

Closed
bartmeuris opened this issue Oct 16, 2014 · 5 comments
Closed

Default command is /usr/sbin/sshd -D #105

bartmeuris opened this issue Oct 16, 2014 · 5 comments

Comments

@bartmeuris
Copy link

When starting a container and the command is empty, "/usr/sbin/sshd -D" is automatically added as CMD. However, my containers already use "/usr/sbin/sshd -D" as ENTRYPOINT - which makes sshd quit because it receives an unknown parameter "/usr/sbin/sshd".

ENTRYPOINTS and CMD's in docker work as following: ENTRYPOINT and CMD are appended when launching a container. CMD can be overridden on commandline by simply providing parameters. ENTRYPOINT can be overriddden with the --entrypoint cmdline flag.

*Using version 0.8 of the plugin

@arienkock
Copy link

entrypoints are meant as a way to customize the execution of commands. making sshd -D your entrypoint seems odd and I think adjusting your images makes more sense than any other fix. If that's not an option. Maybe try adding a non empty Docker command in the plugin config that isn't a param and doesn't do anything? e.g. ; echo nop

@bartmeuris
Copy link
Author

My point is that the plugin cannot handle images which specify an entrypoint. It just blindly passes "/usr/sbin/sshd -D" as a command without even caring what runs inside the container.

Some of my jenkins build images also run supervisord to launch separate services required to complete the build, next to sshd. The plugin attempting to launch sshd automagically screws this up too, I now have to wrap all commands in a script that just ignores all parameters passed to it and set is as entrypoint - losing a lot of flexibility.

Some of my images are also based on other images which already specify an entrypoint for running services. If I don't re-specify the ssh daemon as entrypoint, my default service would be launched with the "/usr/sbin/sshd -D" parameter - which is even more "wrong".

That the option would exist to automatically attempt to start sshd would be fine, but then it would have to do this by overriding the entrypoint, otherwise this will still conflict with existing images.

EDIT: To clarify: I use as entrypoint "/usr/sbin/sshd" and as command "-D" in my jenkins build images - which is how it's intended to be used.

@samrocketman
Copy link
Member

That does not appear to be the behavior in my container. I'm using phusion/baseimage and I'm passing in /sbin/my_init. It is starting it correctly rather than do as @arienkock suggests.

@jpgxs
Copy link

jpgxs commented Apr 11, 2015

In the image's advanced configuration, specify Docker Command as "--"

@KostyaSha
Copy link
Member

Is it still actual?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants