Docker

#see http://stackoverflow.com/questions/19585028/i-lose-my-data-when-the-container-exits
#see https://coderwall.com/p/2es5jw/docker-cheat-sheet-with-examples
#When you use docker run to start a container, it actually creates a new container 
#based on the image you have specified.
#you can restart an existing container after it exited and your changes are still there.
docker start f357e2faab77 # restart it in the background
docker attach f357e2faab77 # reattach the terminal & stdin

#Preparing a private registry
#see https://docs.jelastic.com/docker-private-registry
#see http://stackoverflow.com/questions/33392972/how-can-i-update-docker-opts-in-docker-machine-permanently
#For windows docker 1.13
#initiate session
docker-machine ssh default
vi /var/lib/boot2docker/profile
#and put this params
EXTRA_ARGS='
--label provider=virtualbox
--insecure-registry=10.0.0.1:5000
'
#restart docker-machine restart default

#for dockerD in windows
#in windows dockerd resides inside the virtual machine, you have to enter in session. Version 1 of docker-toolbox.
#if you want to tweak some configuration, you have to create the file: 
sudo touch /etc/docker/daemon.json
#locate the pid of the dockerd daemon process
ps -uxa|grep dockerd
#kill by reloading its new config
kill -SIGHUP pidOfDockerd
#more options in
#see https://github.com/docker/docker/blob/master/docs/reference/commandline/dockerd.md

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s