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

docker-compose build --push <registry> #1126

Closed
cy8aer opened this issue Mar 17, 2015 · 56 comments
Closed

docker-compose build --push <registry> #1126

cy8aer opened this issue Mar 17, 2015 · 56 comments

Comments

@cy8aer
Copy link

cy8aer commented Mar 17, 2015

This would be a nice feature for creating and deploying of containers on a different (development) machine than the productive ones (which may run via image: option)

@cy8aer cy8aer changed the title docker-compose build --push <repository> docker-compose build --push <registry> Mar 17, 2015
@dnephin
Copy link

dnephin commented Mar 18, 2015

Some related issues #213, #457

@jmmills
Copy link

jmmills commented Jul 13, 2015

I would give this a +1 as either an addition to docker-compose or as part of a different "build tool".
In addition it would be nice (and UNIXy) to add an "images" verb, so as to output a flat list of the images built by the tool.
I'm thinking things like this would be possible:

$ docker-compose build
$ docker-compose images | while read i; do docker save $i -o $i.tgz ; done

Thoughts?

[Addendum] Additionally, this would perhaps solve the problem of pushing?

$ docker-compose images | while read i ; do docker push my.registry.server:5000/$i ; done

@PeterRJones
Copy link

+1
docker-compose is the best/easiest way to build a bundle of related docker images. Being able to easily push these resulting docker images to a registry is a natural extension of this workflow. My use-case is a development use-case where a bundle of images are built by Jenkins. I'd like to be able to easily push these images somewhere for developers to pull and use/run.

@FelikZ
Copy link

FelikZ commented Dec 9, 2015

👍

3 similar comments
@rashtao
Copy link

rashtao commented Dec 11, 2015

+1

@binaryanomaly
Copy link

+1

@arthurbarros
Copy link

+1

@crackmac
Copy link

crackmac commented Feb 4, 2016

+1 (and another +1 for a vote feature in github)

@clemensberndt
Copy link

+1

16 similar comments
@tgagor
Copy link

tgagor commented Feb 26, 2016

+1

@bonclay7
Copy link

+1

@wjpbiblio
Copy link

+1

@karlatkinson
Copy link

+1

@paunin
Copy link

paunin commented Mar 1, 2016

+1

@koudaiii
Copy link

koudaiii commented Mar 1, 2016

+1

@groteck
Copy link

groteck commented Mar 1, 2016

👍

@rudijs
Copy link

rudijs commented Mar 4, 2016

+1

@scic
Copy link

scic commented Mar 7, 2016

+1

@dieswaytoofast
Copy link

+1

@norbertmocsnik
Copy link

+1

@akshayl
Copy link

akshayl commented Mar 27, 2016

+1

@GriwMF
Copy link

GriwMF commented Mar 30, 2016

+1

@zrks
Copy link

zrks commented Apr 19, 2016

+1

@AndrisJrs
Copy link

+1

@koliyo
Copy link

koliyo commented Apr 19, 2016

+1

@ptylenda
Copy link

+1

2 similar comments
@Kajvdh
Copy link

Kajvdh commented May 10, 2016

+1

@dwmkerr
Copy link

dwmkerr commented May 11, 2016

+1

@ghost
Copy link

ghost commented May 11, 2016

cy8aer opened this Issue on Mar 17, 2015

Any progress/updates? We have swarm today. In my opinion this is not anything someone wants. Today this is something docker-compose really needs.

Tried building images somewhere in swarm? Doesn't make fun. Having two distinct compose YAMLs, one to build the image, still not being able to push it with compose, another YAML to deploy the service (, again somewhere in swarm).

Assumption on a 100 peer swarm cluster, one would be forced to

  • either build the image 100 times
  • or leave the comfort of compose with different service definitions (+ some shell scripts/Make?).
  • or anything else I might miss here?

@groteck
Copy link

groteck commented May 11, 2016

In my opinion, people wants a solution to the problem of: build the Dockerfile of a service and then push the image to some registry and update the docker-compose.yml.

When other developers want the updated images, They don't have a solution like: pull my new docker images and start my services again, They need to update their docker-compose.yml or build the image on their machines.

NOTE: I don't know if compose is the best tool to do this job or if this way is not considered a "good practice".

@schmunk42
Copy link

We also need a way to do either docker-compose push service or docker-compose image service.

Since you can use a .env file now, it's pretty nice to define the image to be built there. But you need to manually parse it, when you want to use it with docker push, like so:

# workaround for docker-compose environment variables
export $(cat .env | grep -v ^# | xargs)
docker push ${IMAGE_NAME}${IMAGE_TAG}

@omercnet
Copy link

+1

2 similar comments
@joost-van-weenen
Copy link

+1

@agileinsider
Copy link

+1

@jmmills
Copy link

jmmills commented Jun 13, 2016

It seems that this feature is no-longer needed with the creation of the captain tool?

@dnephin
Copy link

dnephin commented Jul 27, 2016

Compose 1.8 currently available as RC2 has added docker-compose push for pushing images created by docker-compose build. It's not a flag on build, but it should provide the requested functionality.

@dnephin
Copy link

dnephin commented Jul 27, 2016

Since harbur/captain was mentioned above, I thought I might also mention dobi. It's a different take on the same problem of automating build tasks with docker (build, test, push, etc).

@jmmills
Copy link

jmmills commented Jul 27, 2016

Interesting, thanks for the reference to dobi. It looks like it handles tagging and test targets better than captain, but no registry pushing.

Thanks,
Jason Mills

  • sent from mobile.

On Jul 26, 2016, at 6:26 PM, Daniel Nephin notifications@github.com wrote:

Since harbur/captain was mentioned above, I thought I might also mention dobi. It's a different take on the same problem of automating build tasks with docker (build, test, push, etc).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@dnephin
Copy link

dnephin commented Jul 27, 2016

You can push to a registry with an image:push task. There's no official examples of this just yet, but you would create an alias and put <resource_name>:push as one of the tasks, or run dobi <resource_name>:push from the command line to push an image.

For example, I use DOBI_VERSION=0.4 dobi dist-img:push to push the official dobi image to the hub.

The config is here: https://github.com/dnephin/dobi/blob/b07d8b124/dobi.yaml#L34-L37

@jmmills
Copy link

jmmills commented Jul 27, 2016

Not to derail this thread, but how does that work with private registries? Prefix the image name with the registry address?

Thanks,
Jason Mills

  • sent from mobile.

On Jul 26, 2016, at 6:54 PM, Daniel Nephin notifications@github.com wrote:

You can push to a registry with an image:push task. There's no official examples of this just yet, but you would create an alias and put <resource_name>:push as one of the tasks, or run dobi <resource_name>:push from the command line to push an image.

For example, I use DOBI_VERSION=0.4 dobi dist-img:push to push the official dobi image to the hub.

The config is here: https://github.com/dnephin/dobi/blob/b07d8b124/dobi.yaml#L34-L37


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@jhagege
Copy link

jhagege commented Sep 15, 2016

+1

4 similar comments
@prdonahue
Copy link

+1

@Rinkana190
Copy link

+1

@kilianc
Copy link

kilianc commented Oct 21, 2016

+1

@ldshi
Copy link

ldshi commented Oct 31, 2016

+1

@ldshi
Copy link

ldshi commented Oct 31, 2016

So can someone explain the status of this proposal? @aanand @Vanuan @michael-k

And actually after this I just went through these two topics also: Deploying a registry server and #3900 - Docker compose pull does not work with custom registry

It's a bit hard to understand, since docker has both the abilities 'running a registry server' and 'docker-compose(pull)', why not integrate these two seamlessly?

But still recommend this proposal: just integrate with a well-known service providers, like Github, Bitbucket, AWS, Google Cloud, Azure etc, running own registry server the speed, security gonna be some serious problem/bottleneck.

@valiro21
Copy link

valiro21 commented Jan 2, 2017

+1

@mathroc
Copy link

mathroc commented Apr 17, 2017

you can now choose the image name & tag when building a service:

If you specify image as well as build, then Compose names the built image with the webapp and optional tag specified in image:

https://docs.docker.com/compose/compose-file/#build

this name is then used when using docker-compose push

that mean you do something like this:

services:
  service:
    build: .
    image: registry.acme.com/acme/service:latest

and it works !

# docker-compose push
Pushing service (registry.acme.com/acme/service:latest)...
The push refers to a repository [registry.acme.com/acme/service]

@wayoung
Copy link

wayoung commented May 30, 2017

If I push 3 services to a private repository using this method and a single docker-compose.yml, can I docker-compose pull all three services with just one command, or do I need to pull them all back separately?

@omercnet
Copy link

@wayoung you can simply 'docker-compose pull' to pull all the remote images

@wayoung
Copy link

wayoung commented May 30, 2017

That only works if I am in the same directory as the docker-compose.yml. I'm thinking of the case where I docker-compose push to the registry, then try to pull it down on another machine without the original docker-compose.yml. Is that possible?

@Vanuan
Copy link

Vanuan commented May 31, 2017

@wayoung
How it's supposed to know which images you're trying to pull without any information provided by you?
You'd still need compose file to start services, why won't you just copy it?

@ijc
Copy link

ijc commented Mar 26, 2019

Issue grooming: According to #1126 (comment) this was fixed (by providing docker-compose push) in 1.8 rc2. Therefore closing.

@ijc ijc closed this as completed Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests