Last active
January 5, 2021 16:16
-
-
Save kozak127/9d009940c772abf0e3381c1a81b7b768 to your computer and use it in GitHub Desktop.
OSX CMD Docker DockerCompose Toolchain
This file contains hidden or 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
# paste this into .zshrc/.bashrc | |
# check if `docker-machine` command exists | |
if command -v docker-machine > /dev/null; then | |
# fetch the first running machine name | |
local machine=$(docker-machine ls | grep "Running" | head -n 1 | awk '{ print $1 }') | |
if [ "$machine" != "" ]; then | |
eval "$(docker-machine env $machine)" | |
fi | |
fi |
This file contains hidden or 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
#!/bin/bash | |
cd ~/Tools/docker/ | |
docker-machine start default | |
docker-machine env | |
eval $(docker-machine env) | |
docker-compose up |
This file contains hidden or 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
#!/bin/bash | |
# troubleshooting | |
# https://medium.com/crowdbotics/a-complete-one-by-one-guide-to-install-docker-on-your-mac-os-using-homebrew-e818eb4cfc3 | |
# https://docs.docker.com/machine/drivers/virtualbox/ | |
brew install docker docker-machine | |
brew install --cask virtualbox | |
# need password | |
# possibly need to address System Preference setting | |
# after changing settings, run script again | |
docker-machine create -d virtualbox --virtualbox-disk-size "128000" --virtualbox-memory "8192" --virtualbox-cpu-count 6 --virtualbox-hostonly-cidr "192.168.98.1/24" default | |
echo '192.168.98.100 dockerhost' | sudo tee -a /etc/hosts | |
sudo killall -HUP mDNSResponder | |
# need password, DO NOT rerun script | |
docker-machine env default | |
eval "$(docker-machine env default)" | |
docker run hello-world | |
docker-machine stop default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment