Skip to content

Instantly share code, notes, and snippets.

@aimakun
Last active May 3, 2019 12:29
Show Gist options
  • Save aimakun/2713ce3a964d4e8edac14c6ccb031115 to your computer and use it in GitHub Desktop.
Save aimakun/2713ce3a964d4e8edac14c6ccb031115 to your computer and use it in GitHub Desktop.
How to install Mutagen & setup project to resolve shared volumes slowness in Docker (local)

How to install Mutagen & setup project

  • brew install havoc-io/mutagen/mutagen https://mutagen.io/documentation/installation/
  • Include mutagen daemon start into ~/.bashrc (others maybe .zshrc etc, or manually run prior use)
  • In docker-compose.yml, remove shared volumes (remember paths for mutagen create)
  • Create first setup shell script for team each paths would add command like this:
mutagen create [path-to-host] docker://$(docker-compose ps -q [service-name])/[container-target-path] \
    --default-owner-beta=[default-app-owner-eg-www-data] \
    --ignore-vcs \
    --sync-mode=two-way-resolved

First time usage:

docker-compose up -d
bash ./setup-codesync.sh

Later usage: Just make sure mutagen daemon start and docker-compose up -d are working properly.

Note: You can check sync states from each sessions with mutagen list and also cleanup by mutagen terminate --all and start over

#!/bin/bash
mutagen daemon start
mutagen create [path-to-host] docker://$(docker-compose ps -q [service-name])/[container-target-path] \
--default-owner-beta=[default-app-owner-eg-www-data] \
--ignore-vcs \
--sync-mode=two-way-resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment