Coder Social home page Coder Social logo

Comments (8)

xh3b4sd avatar xh3b4sd commented on April 28, 2024

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.

from go-dockerclient.

fsouza avatar fsouza commented on April 28, 2024

@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.

from go-dockerclient.

fsouza avatar fsouza commented on April 28, 2024

I've fixed the link in the issue description.

from go-dockerclient.

xh3b4sd avatar xh3b4sd commented on April 28, 2024

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 ?

from go-dockerclient.

xh3b4sd avatar xh3b4sd commented on April 28, 2024

That issue is now partially solved.

from go-dockerclient.

fsouza avatar fsouza commented on April 28, 2024

Thanks @zyndiecate! :)

from go-dockerclient.

fsouza avatar fsouza commented on April 28, 2024

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.

from go-dockerclient.

fsouza avatar fsouza commented on April 28, 2024

It's now fixed.

from go-dockerclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.