Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify volume mount? #28

Closed
fatso83 opened this issue Nov 1, 2021 · 4 comments · May be fixed by #29
Closed

How to specify volume mount? #28

fatso83 opened this issue Nov 1, 2021 · 4 comments · May be fixed by #29

Comments

@fatso83
Copy link

fatso83 commented Nov 1, 2021

How would I mount the local directory as a volume? I would like to run this command using the GH action, but I see no option to mount volumes.

docker run --rm -v "$(pwd):/app" slashmo/swiftformat
@tony
Copy link

tony commented Nov 8, 2021

I'm in the same spot, it gives me:

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.

@tony
Copy link

tony commented Nov 8, 2021

@fatso83 Try this:

options: --rm -v ${{ github.workspace }}:/zap/wrk/:rw

In your case it would be: docker run --rm -v "${{ github.workspace }}:/app" slashmo/swiftformat

I found this via:

@fatso83
Copy link
Author

fatso83 commented Nov 9, 2021

Perfect! Great to see it is mentioned, but it would be even better with an explicit text. Easy to miss a small -v in a wall of text 😄

@fatso83 fatso83 closed this as completed Nov 9, 2021
fatso83 added a commit to fatso83/docker-run-action that referenced this issue Nov 9, 2021
The examples are a bit too brief: this adds some context.

would have closed addnab#28
@fatso83
Copy link
Author

fatso83 commented Dec 23, 2021

Added a PR for this btw. Still waiting six weeks in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants