Skip to content

Instantly share code, notes, and snippets.

View binario200's full-sized avatar

Victor Hernandez binario200

View GitHub Profile
@binario200
binario200 / DockerGDL Demo
Last active March 10, 2016 16:17 — forked from iax7/DockerGDL Demo
DockerGDL Meetup Demo
docker search postgres
docker pull postgres
docker images
docker ps -a
docker run -e POSTGRES_PASSWORD=changeme -d postgres
docker log -f {name}
docker inspect {name} | less
# have account at https://cloud.docker.com/
# have accoutn at https://hub.docker.com/
1.- Click at Nodes (menu option) at docker cloud
2.- Click "Bring your own node"
3.- Run the curl command to link you host with docker cloud
3.1 Log into you host (loko will provide the ip/user/passw for the host)
ssh user@ip_provider_by_loko
provide the user pass
su - #become root
# http://sebgoa.blogspot.mx/2015/04/1-command-to-kubernetes-with-docker.html
# You need to have docker installed on one machine.
# check for docker compose installation if not install it with
curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# check for correct installation with
docker-compose version
## taken from https://stormpath.com/blog/build-nodejs-express-stormpath-app/
## you will find there what is what.
mkdir the-app
cd the-app
## create a package.json used by Node.js to keep track what modules your projects depeneds on.
npm init
## Now let’s install the libraries we want to use.
// donwload the test app
git clone [email protected]:jdleesmiller/docker-chat-demo.git
//unsetting docker variables for old docker machines or things like that
unset ${!DOCKER_*}
// raise the app with compose
docker-compose up
//open a browser and type
//for linux systems check -> https://docs.docker.com/linux/
which curl
sudo apt-get update
sudo apt-get install curl
curl -fsSL https://get.docker.com/ | sh
//check for add the user to the docker group to avoid have to run docker with sudo
# copyng files from an outside box to you directory
scp -i infolob-analytics.pem [email protected]:/home/ubuntu/.pm2/logs/index-out-0.log .
# running image, configuring port, environment var
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=visualuser -e POSTGRES_USER=visualuser -d postgres
# running a continaer and attaching it
docker run -i -t centos
docker pull nginx
docker volume create --name barcelona
docker volumen ls
//running the container with the volume
docker run -it -v barcelona:/barcelona --name volumeslab nginx /bin/bash
//whithin the container go to the volume mounted
// here will going to see how to connect containers
//but wait why don't jus try simple LINKING CONTAINERS? so lets see
// pull the no sql redis database
docker pull redis
// run a container with the database, check for parameter -d for the daemon way of run the container
docker run -d --name redis1 redis
//run other container using the redis database
// this time we will explore the use of Docker compose
// first check is already installed
docker-compose version
// for windows and mac is installed with docker tools
// linuxs users https://docs.docker.com/v1.5/compose/install/#install-compose
// could need to run the commands as super user
curl -L https://github.com/docker/compose/releases/download/1.1.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose