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

Allow use of default CMD in Docker slave container #7

Closed
mamciek opened this issue Apr 2, 2014 · 2 comments
Closed

Allow use of default CMD in Docker slave container #7

mamciek opened this issue Apr 2, 2014 · 2 comments

Comments

@mamciek
Copy link
Contributor

mamciek commented Apr 2, 2014

When launching Docker slave the defult CMD in container is always overriden:

src/main/java/com/nirima/jenkins/plugins/docker/DockerTemplate.java:

containerConfig.setCmd(new String[]{"/usr/sbin/sshd", "-D"});

Please allow to run default CMD as defined in Dockerfile of slave container or at least add config option where it would be possible to provide a command that should be run

@sduchesneau
Copy link
Contributor

Hi, I added a simple parameter "Docker Command" on this repo here: https://github.com/sduchesneau/docker-plugin

It does not use the Default CMD, but it allows me to set a default command ( I use /sbin/init on tianon/ubuntu-init )

It works for me. (for convenience, I put the compiled .jar here -> http://stepd.ca/docker-plugin.jar)

To build it on ubuntu 12.04, with maven:

sudo apt-get install openjdk-6-jdk maven2
git clone git@github.com:sduchesneau/docker-plugin.git
cd docker-plugin
mvn install

(then install the docker-plugin.hpi file to jenkins from advanced tab in "Manage Plugins" and restart jenkins)

Please let me know if it works for you. (I've just sent a pull request.)

@magnayn
Copy link
Contributor

magnayn commented Apr 16, 2014

Merged - thx

@magnayn magnayn closed this as completed Apr 16, 2014
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

3 participants