I have installed Docker Toolbox on my Windows machine.
so when I need to start some Docker containers I:
cd to command to go to the dir where I have some specific docker-compose.yml filedocker-compose up -dcan I have all of this in a .bat file so I just click and don't lose time typing the same everytime I need to start the container?
Create a .bat file with following content:
@echo off
setlocal
"%GIT_INSTALL_ROOT%\bin\bash.exe" --login -i "%DOCKER_TOOLBOX_INSTALL_PATH%\start.sh"
"%PROJECT_LOCATION%/yourDockerComposeCommandsHere.sh
And the yourDockerComposeCommandsHere.sh file with commands you would like to run.
e.g.
#!/bin/sh
cd $PROJECT_LOCATION
docker-compose up -d ...
docker-compose up -d ...
docker-compose up -d ...
Do not forget to setup environment variables: GIT_INSTALL_ROOT, DOCKER_TOOLBOX_INSTALL_PATH, PROJECT_LOCATION.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With