Skip to content

Instantly share code, notes, and snippets.

@GeorgeBekh
Last active March 23, 2018 13:39
Show Gist options
  • Save GeorgeBekh/d4d787d76687163b22fe2aa5dad7c336 to your computer and use it in GitHub Desktop.
Save GeorgeBekh/d4d787d76687163b22fe2aa5dad7c336 to your computer and use it in GitHub Desktop.
eval (ssh-agent -c) > /dev/null
function dps
docker ps $argv
end
function gp
git pull $argv
end
function gps
git push $argv
end
function dexec
docker exec -it $argv bash ^/dev/null
if test $status -ne 0
docker exec -it $argv sh
end
end
function docker-remote
env DOCKER_HOST=tcp://"$argv[1]":2375 docker $argv[2..-1]
end
function d
docker $argv
end
function node
set containerName "fish-docker-node-"(random)
set_color green
echo $containerName
set_color normal
docker run \
--rm \
-i \
-u (id -u)":"(id -g) \
--env SSH_AUTH_SOCK=/tmp/agent.sock \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-v "$SSH_AUTH_SOCK":/tmp/agent.sock \
-v "$HOME":"$HOME" \
-v (pwd):/app \
-w /app \
--name $containerName \
node:8.9-alpine sh -c "$argv"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment