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

Push docker image to multiple locations #1125

Closed
mcelligott opened this issue Aug 6, 2015 · 4 comments
Closed

Push docker image to multiple locations #1125

mcelligott opened this issue Aug 6, 2015 · 4 comments

Comments

@mcelligott
Copy link

We are building a platform that uses Drone for CI and building Docker images. We would like to push some docker images to more than one repository on bintray. As it stands right now, we can only push to one location, limiting our functionality. It would be great to be able to specify more than one docker push destination

@bradrydzewski
Copy link

@mcelligott in our next release we are moving toward an external plugin model:
https://github.com/drone-plugins/drone-docker

Since plugins are just docker containers that accept a defined json input, they are extremely simple and straightforward to create. If publishing pushing an image to multiple endpoints is a common use case we can build directly into the existing Docker plugin. If it is a less-common use case, and more specific to the system your are building (is this for shipped?) I would recommend extending the plugin (ie fork the Docker plugin and modify).

Either way, this is definitely possible

@mcelligott
Copy link
Author

Yes, this is for shipped. We've become very aware recently that we may have multiple projects using the same repository. Since drone uses a 1-to-1 association between its own repositories and those from github, we're looking to configure the drone repos to push individual docker images for each project

@bradrydzewski
Copy link

Got it. Yes, the current yaml format limits the ability to declare a publish or deploy step multiple times. This limitation is removed in the upcoming release. In fact, we need the same capability for the Drone project. Our repository will need to create and publish two images as part of the build process.

You can read a bit more about the upcoming new yaml format here:
http:https://readme.drone.io/docs/build/#/deploy.md

@bradrydzewski
Copy link

closing as a dupe of #696 which was fixed in the 0.4 branch. You can now execute multiple of the same deployment steps. This means the .drone.yml can be configured to publish multiple docker images, something like this:

publish:
  docker_foo:
    image: plugins/drone-docker
    repo: octocat/foo
    ...
  docker_bar:
    image: plugins/drone-docker
    repo: octocat/bar
    ...

note in above example, docker_foo and docker_bar are simply labels that name the steps. The plugins/drone-docker image refers to the plugin used to publish to the index.

If you prefer to combine this into a single plugin I would recommend creating a custom plugin. You could start with the drone-plugins/drone-docker plugin, fork, and alter to meet your specific needs.

More info about creating custom plugins here:
http:https://readme.drone.io/docs/plugin/

webwurst added a commit to armhf-docker-library/weave that referenced this issue Feb 4, 2016
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

2 participants