Unable to mount docker to $(pwd) [exec]
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
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:
- Create a action with JavaScript
- 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/execwork likechild_process/execSync.
Desktop (please complete the following information):
- OS:
runs-on: ubuntu-latest
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the @actions/exec entry point used by exec.exec and compare its command handling with Node's child_process.execSync, using the Docker command and error in the report as the reproduction. Done means the documented current-path Docker volume command behaves as expected, with coverage or clarified behavior for shell command substitution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, node.js, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100