- https://www.docker.com
- https://hub.docker.com
- https://dzone.com/refcardz/getting-started-with-docker-1
- https://dzone.com/articles/why-docker-is-not-yet-widely-successful-in-product
- https://jpetazzo.github.io/2013/10/16/configure-docker-bridge-network/
- http://www.slideshare.net/tarkasteve/developerweek-2015-docker-tutorial
docker ip
docker ps
docker ps -l
docker ps -a
docker search <keyword>
docker run <image> <command>
example:
docker run ubuntu /bin/echo 'Hello World'
docker run -it <image>
example:
docker run -it ubuntu /bin/echo 'Hello World'
docker run --rm -it <image>
docker run -d <image>
example:
docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"
docker run -d -p 80:80 nginx
docker run -it -p <ext port>:<internal port> <image>
example
docker run -it -p 80:80 nginx
docker run -it -v <host dir>:<container dir> <image>
example
docker run -it -v ~/devl/tmp/:/data kalilinux/kali-linux-docker bash
docker stop <container>
docker rm <container>
docker rm $(docker ps -a -q)
docker rm -f <container>
docker exec -it <container> bash
docker exec -it --user root <container> bash
docker exec -it <container> <command>
docker logs <container>
docker logs -f <container>
docker port <container>
docker pull <username>/<repository>:<tag>
docker push <username>/<repository>:<tag>
docker inspect <container>
docker images
docker rmi <image>
docker rmi $(docker images -q -f dangling=true)
docker history image
docker top <container>
docker build -t <image name> .
docker commit -m "<message>" -a "<author>" <container> <username>/<repository>:<tag>
docker export <container> > <filename>.tar
docker import <filename.tar> <image name>
docker save <image>
docker load < <filename.tar>
docker-machine ssh default 'sudo ntpclient -s -h pool.ntp.org'
docker network ls
docker network create <network name>
docker network connect <network name> <container name>
docker run --network <network name> <image> <command>
docker volume ls
docker volume ls -qf dangling=true
docker volume rm <volume id>
docker run -it java:9 jshell
docker run -it --rm dockerfile/java:oracle-java8 java -version
docker run -it --rm javajudd/jcurl java -Djavax.net.debug=all -jar jcurl.jar https://www.grc.com
docker run --name memcache -p 11211:11211 -d memcached
docker run --name <name> -e MYSQL_ROOT_PASSWORD=root+1 -e MYSQL_DATABASE=<db> -e MYSQL_USER=<user> -e MYSQL_PASSWORD=<password> -p 3306:3306 -d mysql:latest
docker run --name mysql -e MYSQL_ROOT_PASSWORD=root+1 -p 3306:3306 -d mysql:5.5.44
Jenkins - https://hub.docker.com/_/jenkins/
docker run -d -p 8080:8080 -p 50000:50000 --name jenkins -v /var/jenkins_home jenkins/jenkins:lts
docker run -d -p 8081:8081 --name nexus -v /sonatype-work sonatype/nexus
Postgres - https://hub.docker.com/_/postgres/
docker run -d --name sonar-postgres -v /var/lib/postgresql/data -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -e POSTGRES_DB=sonar postgres
Sonarqube - https://hub.docker.com/_/sonarqube/
docker run -d --name sonarqube \
-v /opt/sonarqube \
--link sonar-postgres:db \
-p 9000:9000 -p 9092:9092 \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
-e SONARQUBE_JDBC_URL=jdbc:postgresql://db/sonar \
sonarqube
docker run -it --rm -v $(pwd):/work mnuessler/pdftk $(for i in $(seq 1 40); do echo -n "1_MB.pdf "; done) cat output 40.pdf
docker run -p 9000:9000 -d --name portero javajudd/portero
docker run -d -p 8000:8000 --name my-site microsoft/iis
docker run --name wordyninjadb -e MYSQL_ROOT_PASSWORD=root+1 -e MYSQL_DATABASE=wordyninjadb -e MYSQL_USER=wordyninja -e MYSQL_PASSWORD=password+1 -p 3306:3306 -d mysql:latest
https://hub.docker.com/r/eaudeweb/mailtrap/
docker run -d --name=mailtrap -p 80:80 eaudeweb/mailtrap
docker-machine create -d virtualbox <machine_name>
docker-machine -D create \
--driver amazonec2 \
--amazonec2-access-key <aws-access-key> \
--amazonec2-secret-key <aws-secret-key> \
--amazonec2-region <aws-region> \
--amazonec2-vpc-id <aws-vpc> \
--amazonec2-zone <aws-zone> \
<machine-name>
docker-machine create --driver digitalocean --digitalocean-access-token <digitalocean-token> <machine-name>
docker-machine rm <machine-name>
docker-machine ls
docker-machine env <machine-name>
eval "$(docker-machine env <machine-name>)"
VBoxManage controlvm "<docker-machine name>" natpf1 "<descriptive name of port>,tcp,,<host port>,,<guest port>"
example
VBoxManage controlvm "iq" natpf1 "iq-tcp-port,tcp,,9090,,9090"
VBoxManage controlvm "<docker-machine name>" natpf1 delete "<descriptive name of port>"
example
VBoxManage controlvm "iq" natpf1 delete "iq-tcp-port"