Skip to content

Set workdir when using docker.run #691

Description

@khusseini

Hello there,

how do I set the workdir parameter for docker run? I have been trying:

const docker = new Docker();
  if (task.image) {
    return await docker
      .run(task.image, ["/bin/sh", "-c", task.cmd], process.stdout, {
        Volumes: {
          "/opt/repository": {},
        },
        Hostconfig: {
          Binds: [`${repositoryPath}:/opt/repository`],
        },
        Workdir: "/opt/repository",
      })
      .then(([output, container]) => container.remove());
  }

but unfortunately it is not working

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions