[zsh][docker] Use link for ssh auth

Otherwise docker may return that the volume cannot be found.
Because SSH_AUTH_SOCK may change (e.g.
after a reboot)
This commit is contained in:
Mathieu Maret 2015-06-18 15:46:13 +02:00 committed by Mathieu Maret
parent 02bd808f80
commit 1e630967e1

View File

@ -160,8 +160,15 @@ function secure_chromium {
}
sdocker (){
DOCKER_SSH_AUTH=$HOME/docker_ssh_auth
if [ -n "$SSH_AUTH_SOCK" ]; then
SSH_AUTH_ARGS="-v $SSH_AUTH_SOCK:/tmp/ssh_auth -e SSH_AUTH_SOCK=/tmp/ssh_auth"
$(ls -l $HOME/docker_ssh_auth 2> /dev/null | grep $SSH_AUTH_SOCK > /dev/null)
if [ $? ];
then
unlink $DOCKER_SSH_AUTH > /dev/null
ln -s $SSH_AUTH_SOCK $DOCKER_SSH_AUTH
fi
SSH_AUTH_ARGS="-v $DOCKER_SSH_AUTH:/tmp/ssh_auth -e SSH_AUTH_SOCK=/tmp/ssh_auth"
fi
AOSP_ARGS=${AOSP_ARGS:--it}
img=$(docker ps | grep $1 | awk '{print $1}');