Implement -f / --file argument in container-script #7099
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using -f / --file argument to container-script, and pointing it to
some path which isn't beneath cwd or home, the call would have failed
previously, like:
$ docker-compose -f /tmp/docker-compose.yml up
ERROR: .FileNotFoundError: [Errno 2] No such file or directory: '/tmp/docker-compose.yml'
After this patch:
$ docker-compose -f /tmp/docker-compose.yml up
Creating tmp_alpine_1 ... done
Attaching to tmp_alpine_1
tmp_alpine_1 exited with code 0
It also aborts the parsing at docker-compose verbs so it doesn't
confuse docker-compose args with anything thats ment for a command in
the container:
$ docker-compose -f /tmp/docker-compose.yml run alpine echo --file /tmp/kex.xml
--file /tmp/kex.xml