Category : dockerode

I’m trying to figure out why dockerode stream directs all data written to the stream directly to the output of the stream. This is how I create the container, I call the .write() method on the this.stream object. this.container = await this.dockerConnection.createContainer({ Image: this.image, Tty: true, Cmd: cmd, HostConfig: { NetworkMode: "none", Binds: [this.mountPath + ..

Read more

I am trying to use dockerode to execute this docker command docker run –rm –mount type=bind,source=$HOME/docker-bind,target=/output wpscanteam/wpscan:latest -o /output/wpscan-output.json –format json –url ‘https://example.com/’ Here is what I tried however when I run this makes the container with the proper commands however it (almost) immediately exits and when i docker container inspect the contatiner that was ..

Read more

Update I Think I need to use the .run instead of .createContainer I got the command to work without a mount however im not sure how to bind docker container to my cwd docker.run("wpscanteam/wpscan", [ // "–mount", // "type=bind,source=" + process.cwd() + "/docker-bind,target=/output", // "-o", // "/output/wpscan-output.json", "–format", "json", "–url", "https://exclnetworks.com/", ], process.stdout, function (err, ..

Read more

I’m trying to use dockerode to access the Docker API. My goal is to get container data for all containers in the multi node swarm. It appears that docker.listContainers( {all: true } ) is scoped to only returns containers running on the calling node, in my case my manager node. https://docs.docker.com/engine/api/v1.37/#operation/ContainerList How do we use ..

Read more

What I’m trying to achive is to correctly bind container stdout and stderr to two previously created streams by using Dockerode, a library to handle everything about Docker with NodeJS that use Docker API under the hood. Here is the code: export class Runner { // Some methods private execRunCommands(commands: string[], runnerInfo: IRunnerInfoExtended): Observable<IRunnerInfoExtended> { ..

Read more