From 1d4c5b0e7d64d2387a34075cb0d608cc6a2d1c93 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 11 Sep 2017 03:33:19 +0000 Subject: [PATCH] add docker-compose +more --- functions | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/functions b/functions index 5da4cab..cd3a528 100644 --- a/functions +++ b/functions @@ -1,7 +1,7 @@ # Stuff to make Cloud OS / Container Linux # less type-tastic -d () { +dh () { docker run \ -e TERM \ -e HOME \ @@ -21,6 +21,7 @@ irssi () { fi docker attach irssi + echo } alias dev_appserver.py="_dev_appserver" @@ -30,21 +31,48 @@ _dev_appserver () { --rm \ -p 8080:8080 \ -p 8000:8000 \ - -v $appdir:/app \ + -v $appdir:/app:ro \ google/cloud-sdk \ dev_appserver.py --host=0.0.0.0 --admin_host=0.0.0.0 /app "$@" } dbtl () { - d --rm -it dbtl "$@" + dh \ + --rm \ + -it \ + -w "$(pwd)" \ + dbtl "$@" } backup () { - d --rm google/cloud-sdk gsutil -m rsync \ - -r \ - -d \ - -x tmp \ - -x src \ - $HOME \ - gs://neale-private/fozzie + dh \ + --rm \ + google/cloud-sdk gsutil \ + -m rsync \ + -r \ + -d \ + -x tmp \ + -x src \ + -x go \ + $HOME \ + gs://neale-private/fozzie + echo } + +go () { + dh \ + --rm \ + -e GOPATH=$HOME/go \ + -w "$(pwd)" \ + golang:1.6 go "$@" +} + +docker-compose () { + docker run \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(pwd):$(pwd) \ + --rm \ + --workdir $(pwd) \ + docker/compose:1.16.1 "$@" +} +