From c9d73ad86bf7c1c0e6660dd9561e7949cca85dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Grodziski?= Date: Tue, 21 Jul 2020 22:41:12 +0200 Subject: [PATCH] --- docker-aliases.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docker-aliases.sh b/docker-aliases.sh index 9bd24f0..2a9b4dc 100644 --- a/docker-aliases.sh +++ b/docker-aliases.sh @@ -8,6 +8,7 @@ # wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash # # # # Usage: # +# daws : aws cli in docker with # # dc : docker-compose # # dcu : docker-compose up -d # # dcd : docker-compose down # @@ -23,7 +24,6 @@ # drmc : remove all exited containers # # drmid : remove all dangling images # # drun : execute a bash shell in NEW container from # -# dsp : docker system prune --all # # dsr : stop then remove # # # ############################################################################ @@ -46,7 +46,7 @@ function dip-fn { echo $OUT|column -t } -function dex-fn { +function dex-fn { docker exec -it $1 ${2:-bash} } @@ -88,7 +88,16 @@ function dc-fn { docker-compose $* } -alias dc="dc-fn" +function d-aws-cli-fn { + docker run \ + -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ + -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \ + -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \ + amazon/aws-cli:latest $1 $2 $3 +} + +alias daws=d-aws-cli-fn +alias dc=dc-fn alias dcu="docker-compose up -d" alias dcd="docker-compose down" alias dcr=dcr-fn