Add -f parameter when running Docker Toolbox

穿精又带淫゛_ 提交于 2019-12-11 05:25:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!