Created
October 4, 2020 16:38
-
-
Save tonydspaniard/6f88891eaaa23183fcb6cf1249860649 to your computer and use it in GitHub Desktop.
Docker + Mutagen for MacOSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
COMPOSE="docker-compose -f docker-compose.yml" # -f docker-compose-override.yml | |
if [ $# -gt 0 ]; then | |
if [ "$1" = "up" ]; then | |
shift 1 | |
$COMPOSE up "$@" -d --build | |
mutagen sync terminate {SERVICE NAME} # this will display a warning if wasn't created before, but will run | |
mutagen sync create \ | |
--name={SERVICE NAME} \ | |
--ignore=logs \ | |
$(pwd) docker://root@{YOUR IMAGE NAME}/{YOUR PATH IN THE IMAGE} | |
elif [ "$1" = "down" ]; then | |
mutagen sync terminate {SERVICE NAME} | |
$COMPOSE down --remove-orphans | |
elif [ "$1" = "start" ]; then | |
shift 1 | |
$COMPOSE start "$@" | |
mutagen sync terminate {SERVICE NAME} # this will display a warning if wasn't created before, but will run | |
mutagen sync create \ | |
--ignore=logs \ | |
--name={SERVICE NAME} \ | |
$(pwd) docker://root@{YOUR IMAGE NAME}/{YOUR PATH IN THE IMAGE} | |
elif [ "$1" = "stop" ]; then | |
mutagen sync terminate {SERVICE NAME} | |
$COMPOSE stop | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
./mutadocker up|down|start|stop