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.
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) => { ... }
);
Most helpful comment
You can pass a
ReadableStreamor point to the location of aDockerfilewith.buildImage().After successfully building, you can use the
.push()function on theImageclass.