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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.