Skip to content

Instantly share code, notes, and snippets.

@erikdstock
Created October 17, 2018 02:52
Show Gist options
  • Save erikdstock/783565c7903372ac6ae7bad2e9b1d258 to your computer and use it in GitHub Desktop.
Save erikdstock/783565c7903372ac6ae7bad2e9b1d258 to your computer and use it in GitHub Desktop.
Docker shell commands
#!/usr/bin/env bash
# Start your built mycoolservice image with a bind mount on its source files in your ./myservice folder
DIR=$(dirname "$0") # relative
ROOT="$( cd "$DIR/.." && pwd )" # root, absolutized and normalized
Start the backend (docker)
cmd="docker run -p 8000:8000"\
" --mount src=$ROOT/myservice,target=/code,type=bind"\
" mycoolservice"
echo $cmd
eval $cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment