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

client: implement BuildImage #18

Closed
fsouza opened this issue Jun 10, 2013 · 8 comments
Closed

client: implement BuildImage #18

fsouza opened this issue Jun 10, 2013 · 8 comments

Comments

@fsouza
Copy link
Owner

fsouza commented Jun 10, 2013

http://docs.docker.io/en/latest/api/docker_remote_api_v1.8/#build-an-image-from-dockerfile-via-stdin.

@xh3b4sd
Copy link

xh3b4sd commented Jan 24, 2014

I am a bit confused about that. Currently I try to build an image using the go client that uses the method ImportImage and references to api docs. That issue says to building an image needs to be implemented. Further the link referenced in that issue is not working as expected.

As I understand it correctly I need to do the following in the current state of the go client:

  • checkout an repository containing a Dockerfile (for example)
  • create an archive of that repository (.tar)
  • call the clients ImportImage method giving it the previously create archive as url or string content

If I would understand that correctly and have implemented it, I would like to create better documentations in form of a pull request. So, maybe someone can tell me in detail if I am right with my assumptions.

@fsouza
Copy link
Owner Author

fsouza commented Jan 24, 2014

@zyndiecate the BuildImage method creates an image from a Dockerfile, while the ImportImage method creates an image from a tar ball.

There's a /build action in the Docker API, unfortunately the link in the description of the issue is broken: http://docs.docker.io/en/latest/api/docker_remote_api_v1.8/#build-an-image-from-dockerfile-via-stdin.

So, ImportImage is the same as docker import (from the command line), while BuildImage is the same as docker build.

@fsouza
Copy link
Owner Author

fsouza commented Jan 24, 2014

I've fixed the link in the issue description.

@xh3b4sd
Copy link

xh3b4sd commented Jan 24, 2014

Ok, cool. I will try to get building images using the remote API to work. My approach in theory would be:

  1. fetching a tarball using a stream
  2. dispatch that stream to c.stream as the input io.Reader
  3. 🍰

Will see if that works in go as I imagine. Downloading to the filesystem would be bad. May you have any suggestions @fsouza ?

@xh3b4sd
Copy link

xh3b4sd commented Jan 30, 2014

That issue is now partially solved.

@fsouza
Copy link
Owner Author

fsouza commented Jan 30, 2014

Thanks @zyndiecate! :)

@fsouza
Copy link
Owner Author

fsouza commented Jan 30, 2014

We now need to fix the second case: when the client already have the content of the tar file, and pass that to the method using an io.Reader.

@fsouza
Copy link
Owner Author

fsouza commented May 9, 2014

It's now fixed.

@fsouza fsouza closed this as completed May 9, 2014
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

2 participants