Last active
May 30, 2020 15:36
-
-
Save jherax/7b3ddc74e1d752006401dc34cee0003f to your computer and use it in GitHub Desktop.
Load docker and put it in the shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in your .zshrc | |
function docker_clean() { | |
containers=$(docker ps -a -q -f status=exited) | |
# echo $containers | |
if [ "" != "$containers" ] ; then | |
docker rm -v $containers | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in your .zshrc | |
function docker_start() { | |
machine_status=$(docker-machine status) | |
# echo $machine_status | |
# If the machine is already running, it skips the start command | |
# and will fix the environment variables of the current shell. | |
if [ "Stopped" = "$machine_status" ] ; then | |
docker-machine start default | |
fi | |
eval "$(docker-machine env default)" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in your zsh profile | |
function docker_start() { | |
machine_status=$(docker-machine status) | |
# echo $machine_status | |
# If the machine is already running, it skips the start command | |
# and will fix the environment variables of the current shell. | |
if [ "Stopped" == $machine_status ] | |
then | |
docker-machine start default | |
fi | |
eval "$(docker-machine env default)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment