newtmitch / docker-sonar-scanner

Quick sonar scanner docker image
MIT License
129 stars 88 forks source link

Use $PWD instead of $(pwd) #32

Closed jeremych1000 closed 3 years ago

jeremych1000 commented 5 years ago

Heya, quick improvement request.

Using $PWD instead of $(pwd) solves two problems.

  1. Best practice and faster according to https://unix.stackexchange.com/questions/173916/is-it-better-to-use-pwd-or-pwd
  2. $(pwd) could break a CI pipeline. For example, running Jenkins using one shot slaves gives this as the directory --> PWD=/home/jenkins-slave/workspace/<repo name>@2 --> and this causes the error message below.
java.io.IOException: Failed to run image 'newtmitch/sonar-scanner:3.2.0-alpine'. Error: 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.
See 'docker run --help'.

Versions used:

newtmitch/sonar-scanner:3.2.0-alpine

docker version Client: Version: 18.09.6 API version: 1.39 Go version: go1.10.8 Git commit: 481bc77 Built: Sat May 4 02:35:27 2019 OS/Arch: linux/amd64 Experimental: false

Server: Docker Engine - Community Engine: Version: 18.09.6 API version: 1.39 (minimum version 1.12) Go version: go1.10.8 Git commit: 481bc77 Built: Sat May 4 01:59:36 2019 OS/Arch: linux/amd64 Experimental: false

newtmitch commented 5 years ago

Are you specifically referencing the use of $(pwd) in the README?

newtmitch commented 3 years ago

Looks like this was addressed at some point, let me know if you still see an issue somewhere.