Dockerode: Is there support for docker push? If so, it's non-obvious

Created on 16 Sep 2016  路  1Comment  路  Source: apocas/dockerode

I was hoping to be able to automate creating and pushing images to a private repository, but from looking at the dockerode code it doesn't seem possible. I can write it myself, but wanted to make sure I'm not missing something first.

question

Most helpful comment

You can pass a ReadableStream or point to the location of a Dockerfile with .buildImage().
After successfully building, you can use the .push() function on the Image class.

client
  .buildImage(
    imageToBuild, // string | NodeJS.ReadableStream
    { /* options... */ },
    (error, res: NodeJS.ReadableStream) => { .... }
  );

// after completion...
client
  .getImage(imageId)
  .push(
    { /* options... */ },
    (error, response: NodeJS.ReadableStream) => { ... }
  );

>All comments

You can pass a ReadableStream or point to the location of a Dockerfile with .buildImage().
After successfully building, you can use the .push() function on the Image class.

client
  .buildImage(
    imageToBuild, // string | NodeJS.ReadableStream
    { /* options... */ },
    (error, res: NodeJS.ReadableStream) => { .... }
  );

// after completion...
client
  .getImage(imageId)
  .push(
    { /* options... */ },
    (error, response: NodeJS.ReadableStream) => { ... }
  );
Was this page helpful?
0 / 5 - 0 ratings