Skip to content

Unable to mount docker to $(pwd) [exec] #490

@TiagoGouvea

Description

@TiagoGouvea

Describe the bug
When mounting docker to $(pwd) with exec, the action failed and I got:

/usr/bin/docker: Error response from daemon: create $(pwd): "$(pwd)" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.

Command called:

const cmd= "docker run -v $(pwd):/tmp tiagogouvea/dpl:v1.10.15 --provider='heroku' ";
await exec.exec(cmd);

ℹ️ Running the same command using child_process.execSync works. Example:

const cmd= "docker run -v $(pwd):/tmp tiagogouvea/dpl:v1.10.15 --provider='heroku' ";
execSync(cmd);

To Reproduce
Steps to reproduce the behavior:

  1. Create a action with JavaScript
  2. Call await exec.exec("docker run -v $(pwd):/tmp tiagogouvea/dpl:v1.10.15");

Expected behavior

  • Want to mount the current path to as docker volume.
  • Wanted to @actions/exec work like child_process/execSync.

Desktop (please complete the following information):

  • OS: runs-on: ubuntu-latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions