update eclipse, reformat

This commit is contained in:
Frieder Schlesier 2015-12-15 16:51:37 +01:00
parent a67cb5be39
commit b15ac2bc00
1 changed files with 48 additions and 48 deletions

View File

@ -7,30 +7,30 @@
# Helper Functions # Helper Functions
# #
dcleanup() { dcleanup() {
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null
} }
del_stopped() { del_stopped() {
local name=$1 local name=$1
local state=$(docker inspect --format "{{.State.Running}}" $name 2>/dev/null) local state=$(docker inspect --format "{{.State.Running}}" $name 2>/dev/null)
if [[ "$state" == "false" ]]; then if [[ "$state" == "false" ]]; then
docker rm $name docker rm $name
fi fi
} }
relies_on() { relies_on() {
local containers=$@ local containers=$@
for container in $containers; do for container in $containers; do
local state=$(docker inspect --format "{{.State.Running}}" $container 2>/dev/null) local state=$(docker inspect --format "{{.State.Running}}" $container 2>/dev/null)
if [[ "$state" == "false" ]] || [[ "$state" == "" ]]; then if [[ "$state" == "false" ]] || [[ "$state" == "" ]]; then
echo "$container is not running, starting it for you." echo "$container is not running, starting it for you."
$container $container
fi fi
done done
} }
# Applications... # Applications...
@ -42,51 +42,51 @@ bro() {
} }
chrome() { chrome() {
# add flags for proxy if passed # add flags for proxy if passed
local proxy= local proxy=
local map= local map=
local args=$@ local args=$@
del_stopped chrome del_stopped chrome
# one day remove /etc/hosts bind mount when effing # one day remove /etc/hosts bind mount when effing
# overlay support inotify, such bullshit # overlay support inotify, such bullshit
docker run -d \ docker run -d \
--memory 2gb \ --memory 2gb \
--net host \ --net host \
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \ -e DISPLAY=unix$DISPLAY \
-v $HOME/Downloads:/root/Downloads \ -v $HOME/Downloads:/root/Downloads \
-v $HOME/Pictures:/root/Pictures \ -v $HOME/Pictures:/root/Pictures \
-v $HOME/Torrents:/root/Torrents \ -v $HOME/Torrents:/root/Torrents \
-v $HOME/.chrome:/data \ -v $HOME/.chrome:/data \
-v /dev/shm:/dev/shm \ -v /dev/shm:/dev/shm \
-v /etc/hosts:/etc/hosts \ -v /etc/hosts:/etc/hosts \
--device /dev/snd \ --device /dev/snd \
--device /dev/dri \ --device /dev/dri \
--device /dev/video0 \ --device /dev/video0 \
--device /dev/usb \ --device /dev/usb \
--device /dev/bus/usb \ --device /dev/bus/usb \
--group-add audio \ --group-add audio \
--group-add video \ --group-add video \
--name chrome \ --name chrome \
fschl/chrome --user-data-dir=/data --force-device-scale-factor=1 \ fschl/chrome --user-data-dir=/data --force-device-scale-factor=1 \
--proxy-server="$proxy" --host-resolver-rules="$map" "$args" --proxy-server="$proxy" --host-resolver-rules="$map" "$args"
} }
eclipse() { eclipse() {
del_stopped eclipse del_stopped eclipse
docker run -it --rm \ docker run -d \
--net host \ --net host \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \ -e DISPLAY=unix$DISPLAY \
-v $HOME/projects/java/workspace:/root/workspace \ -v $HOME/projects/java/workspace:/home/eclipse/workspace \
-v $HOME/.eclipse/plugins:/opt/eclipse/plugins \ -v $HOME/.eclipse/plugins:/opt/eclipse/plugins \
-v $HOME/.eclipse/configuration:/opt/eclipse/configuration \ -v $HOME/.eclipse/configuration:/opt/eclipse/configuration \
--name eclipse \ --name eclipse \
fschl/eclipse-jdk7:latest fschl/eclipse:latest
} }
go() { go() {