dockerode
api needs to be invoked with the following parameters in order to build an image from a dockerfile
ex:
docker.buildImage({
context: __dirname,
src: ['Dockerfile']
}, {
t: 'myDockerImage'
}, function(error, output) {
if (error) {
console.error(error);
}
output.pipe(process.stdout);
});
where context
denotes the directory where the dockerfile is located, src
would contain the files that will be used to create the tarball and generate the dockerimage, and t
denotes the tagname of the dockerimage.
However in my situatation i want to skip mapping the directory and the name of the dockerfile for dockerode to read and create the image from, or, in other word i want to skip the file read operation that goes inside the dockerode and instead suppy the content of the dockerfile directly as a string .
so, if the dockerfile contatins something like this
FROM alpine
I want to pass that string directly to dockeode to build the image instead of writing that text to a dockerfile and passing the path to the file.
is there a way, it would be possible