-
Notifications
You must be signed in to change notification settings - Fork 318
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
Add support for linked containers #74
Comments
👍 for that feature. Is there a current workaround for this? |
+1 |
1 similar comment
+1 |
+1 |
+1 |
+1 This is the only thing preventing me from using the plugin. |
Docker starts and stop container, why do you need link it? |
Right now I'm trying to create a slave for a test environment. The test involve MySQL. If I were using my own machine I'd use
That's a basic example and I may want to add more containers to use for testing/building. |
I think option can be added, but please firstly check that existed configuration and provided options are not enough. Such usage looks like a hardcode of slaves usage. DockerCloud configuration is about running slaves, if you need run additional container for build/test process then AFAIR there is a builder action to run and post-build action to stop it. |
It's core Docker functionality and I would help greatly if I could dynamically provision multiple instances of a container and its linked containers and destroy them afterwards. Also, to be clear, I can't have just one instance of MySQL be shared by myslaveimage. |
What would be really useful would be the ability to specify a I keep meaning to see if the docker-compose code will run in jython, as On Tue, Apr 21, 2015 at 1:34 PM, Kanstantsin Shautsou <
|
Yes, compose would be great. Feed the plugin a compose file instead. But for now linked containers are really important to me. |
Shouldn't be too hard to add as it's just an API parameter and an extra UI It's a pity jenkinsci/jenkins#1448 still On Tue, Apr 21, 2015 at 1:43 PM, Ryan Gannon notifications@github.com
|
If I had the free time I'd do this myself, docker-java already has it in its API. |
I just want to be able to use Docker from Jenkins, on a remote machine. |
Links method appeared in java-docker library, i have version update in my current working branch, so will look later on adding options. |
Thank you. |
@RyanGannon could you describe steps of containers run (what and where) do you expect for you use case? |
I'm not using this plugin currently, but I might use it on a near future and this option would help me greatly. On pre-step when the job start, it start these containers (docker start databse-1 rabbitmq-1 zookeeper-1). They are started within a "shell script" pre-step. What I'd like to have with this plugin is an option to specify a link as either an existing docker container to start/stop or an image to run and clean. |
+1 Using the build steps workaround, suggested previously, adds unnecessary complication to the job configuration. |
+1 Is there a status update on the progress? |
+1 I'm also in a great need of that feature, I see that withLinks() method was implemented in docker-java lib's class CreateContainerCmd.java https://github.com/docker-java/docker-java/blob/master/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java should be easy now right? |
+1 |
I also like the idea of specifying a docker-compose file to launch a set of linked plugins. A bit of research led me to https://github.com/gesellix/docker-client, which provides Java API for docker including support for docker-compose via https://github.com/docker-client/docker-compose-v3. I guess replacing docker-java with docker-client is not an option right now, but maybe docker-compose-v3 could be used to read the docker-compose file and reproduce the compose functionality with docker-java. |
This feature is better addressed today by docker-slaves-plugin |
Sorry for posting on an old issue - Container links are a legacy feature of Docker and may eventually be removed. Is there a recommended new/better way to do this? |
My (limited) understanding is that, for settings where a set of inter-connected/related containers are needed, "all the cool kids" are using Kubernetes these days. It's certainly outside the purpose of this plugin - this plugin is for providing Jenkins with slave nodes, using docker to do so - anything else that can be done by docker is probably best done by issuing docker CLI commands on a slave node that has its own docker daemon. |
Yes, for stuff like this, you probably want the extra control afforded by pipelines, and hence will be using the docker-workflow-plugin instead of the docker-plugin (as per JENKINS-49567) |
The jenkins plugin doesn't currently support linking to other containers. In the command line, you would run like this:
docker run --link othercontainer:alias myimage command
This would need to be added to the HostConfig when starting the container here:
docker-plugin/src/main/java/com/nirima/jenkins/plugins/docker/DockerTemplate.java
Line 313 in d0fe18a
The text was updated successfully, but these errors were encountered: