add docker functions and drone stuff

This commit is contained in:
Simon Bruder 2018-03-27 23:24:21 +00:00
parent 0add03647f
commit 93f6d3af00
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
2 changed files with 38 additions and 0 deletions

32
home/.zshrc.docker Executable file
View file

@ -0,0 +1,32 @@
# Docker function definitions
function speedtest() {
docker run --rm tianon/speedtest
}
function docker-imagecheck() {
created=$(date -d $(docker inspect "$1" | jshon -e 0 -e Created -u) "+%s")
now=$(date "+%s")
if [ "$((created + (5*24*60*60)))" -lt "$now" ];then
echo "$1 is older than 5 days, pulling…"
docker pull $1
else
echo "$1 is up to date, skipping…"
fi
}
function docker-gimp() {
for file in $@; do
files="${files}/home/gui/data/${file} "
done
docker run --rm -d \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $PWD:/home/gui/data/ \
-v /tmp/:/home/gui/tmp/ \
-e DISPLAY \
-e LANG \
-e uid=$UID \
-e gid=$UID \
--device /dev/dri \
r.jalr.de/sbruder/docker-gimp $files
}

View file

@ -155,3 +155,9 @@ alias mpvhdr="mpv --tone-mapping=hable"
export HVSC_BASE="$HOME/Dokumente/sound/HVSC/"
export ESP_ROOT="$HOME/projekte/esp8266/esp-open-sdk"
export ANDROID_HOME="$HOME/projekte/android/sdk"
## include docker functions
source ~/.zshrc.docker
## include drone secrets
[ -e ~/.zshrc.drone ] && source ~/.zshrc.drone