Skip to content

Instantly share code, notes, and snippets.

@toddsby
Last active April 15, 2020 11:35
Show Gist options
  • Save toddsby/dac6421e7770d8f2abdeda2ab5bca223 to your computer and use it in GitHub Desktop.
Save toddsby/dac6421e7770d8f2abdeda2ab5bca223 to your computer and use it in GitHub Desktop.
docker notes
## SETUP DOCKER
Root User: docker
Root Pass: tcuser
/usr/local/bin/boot2docker up && export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375
boot2docker ssh ip addr show dev eth1
docker build -t mysql .
docker build -t toddsby/php .
docker run --name mysql -p 3306:3306 -v /data/mysql:/var/lib/mysql -d toddsby/mysql
docker run -v /data/:/data/ --name apache --link mysql:db -p 80:80 -p 30000:30000 -p 9001:9001 -d toddsby/php supervisord -c /etc/supervisord.conf -n
docker run --rm -v /usr/local/bin/docker:/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba apache
boot2docker ip
boot2docker ssh
mkdir -p /data/mysql
mysql --user=admin --port=3309 --host=192.168.59.103 -p
docker rmi mysql
## Finder -> Connect to Server
cifs://192.168.59.103/data
## Login Guest
cifs://192.168.59.103
## stop all containers
docker stop $(docker ps -a -q)
## remove all containers
docker rm $(docker ps -a -q)
## setup default virtual host to be /data/app/public for laravel
laravel.conf
## add mcrypt to end of php.ini
extension=mcrypt.so
## http://www.cyberciti.biz/faq/unix-linux-cat-append-text-to-a-file/
echo "extension=mcrypt.so" >> /etc/php5/cli/php.ini
echo "extension=mcrypt.so" >> /etc/php5/apache2/php.ini
sudo chmod -R 775 storage
## nano go to bottom of file CTRL + _ then CTRL + V
## http://biostall.com/jump-to-top-or-bottom-of-file-using-the-nano-linux-command
## print the environment variables
printenv
## MySQL HOST
db
## db is added to /etc/hosts
cat /etc/hosts
## https://docs.docker.com/userguide/dockerlinks/
## remove docker containers that are stopped
docker rm `docker ps -a | grep Exit | awk '{ print $1 }'`
## docker list images
docker images
## docker list stopped containers
docker ps -a
## docker remove image
docker rmi <image hash id>
## start servers on apache
supervisord -c /etc/supervisord.conf -n
@toddsby
Copy link
Author

toddsby commented Mar 1, 2018

q: why do my local .dev virtualhosts no longer work in chrome?
a: f'd by google
.dev domains not resolving in chrome
Chrome ignores hosts file
use .local or .test and hope google doesn't f those either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment