问题
I would like to run a docker container using Docker Compose. The docker-compose up
command works fine but I want to specify the location of the docker-compose.yml
file.
This is the command that is working. In this case the location of the docker-compose.yml
file is C:\Users\USERNAME\docker-compose.yml
"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh" docker-compose up
Now when I add the -f
parameter, the Docker Toolbox just crashes. Say I want to put the file under C:\docker-compose.yml
"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh" docker-compose -f "C:\docker-compose.yml" up
Why I need this is because I would dock a Neo4j image using C# code and I am trying to make this string work.
回答1:
You're using BASH so you need to use Linux-style paths - c:\app
becomes /c/app
. Try:
...docker-compose -f /c/docker-compose.yml
The start script in Docker Toolbox just passes through your arguments to BASH, it doesn't do any syntax conversion from Windows.
来源:https://stackoverflow.com/questions/39766405/add-f-parameter-when-running-docker-toolbox