-
Notifications
You must be signed in to change notification settings - Fork 53
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
Spaces in path causes docker run
error in run.sh
#1078
Comments
TL;DR: We can’t support spaces in paths while remaining compatible with a POSIX shell. The interesting bit in the BIND_OPTIONS="-v $(echo $VOLUME_BIND | sed 's/,/ -v /')"
docker run $ODK_DOCKER_OPTIONS $BIND_OPTIONS [...] The first line transforms the This supposes that the arguments to the If Enclosing One option is to use an array variable: BIND_OPTIONS="-v $(echo $VOLUME_BIND | sed 's/,/,-v/')"
IFS=, BIND_OPTIONS_ARRAY=(BIND_OPTIONS)
unset IFS
docker run $ODK_DOCKER_OPTIONS "${BIND_OPTIONS_ARRAY[@]}" [...] The first line transforms Then we ask the shell to create an array (this is the non-POSIX-compliant part; the POSIX shell specification has no concept of array variables) by splitting the Then we need to reset the IFS so that the shell will resume to splitting lines on space characters as normal. And then, finally, we pass the array to the |
It might take me some time to fully read and process this, but that looks like a really thorough investigation and explanation! If this can't be fixed, then I would suggest an alternative solution: graceful error. That would help a lot. It took me a while to figure out what the problem was. Can we do this? |
It can be fixed if we decide to drop the requirement for the The more I think about it, the less I am convinced that POSIX compatibility makes sense for the ODK, and especially for the Docker wrapper script. That thing is entirely dependent on, well, Docker, which is already a Linux-specific technology in the first place (it works on Windows and macOS only through virtualisation of a Linux machine).
Until/unless we make a decision to drop POSIX compatibility as a requirement, yes, we can do that and I agree it would be a good thing to do. |
Overview
I had an ODK repository with spaces in the path (monarch-initiative/mondo-ingest#545), and this resulted in an error when using
run.sh
.The error
docker: invalid reference format
Log
Replicability
mondo builds/
, error:mondo-builds/
, and observe the issue disappear.Additional information
Original context:
run.sh
:docker: invalid reference format.
monarch-initiative/mondo-ingest#545The text was updated successfully, but these errors were encountered: