Skip to content

Instantly share code, notes, and snippets.

@webplumbr
Last active October 5, 2015 22:30
Show Gist options
  • Save webplumbr/47f51d087e730cd896ca to your computer and use it in GitHub Desktop.
Save webplumbr/47f51d087e730cd896ca to your computer and use it in GitHub Desktop.
Getting started with Docker
# fetch a new docker image from the hub
# NOTE: if you run in to permissions issue - run it as a sudo user
docker pull beh01der/logstash-es-kibana
# start a docker container as a daemon in the background
docker run -d beh01der/logstash-es-kibana
# listing active docker containers
docker ps
# stopping an active docker container
docker stop <container-id>
# entering the shell of an active container
docker exec -it <container-id> bash
# starting a container with human readable name and NAT mapping
docker run --name kibana -p 5601:5601 -d beh01der/logstash-es-kibana
# starting a container with mapped volumes
docker run --name kibana -p 5601:5601 -v /path/to/host:/path/to/guest -d beh01der/logstash-es-kibana
# if you run in to access issues to outside world from within docker container specify the DNS server
# while initializing a docker container with option --dns=130.216.35.35
# You can also specify the --dns option in the /etc/default/docker file when docker fires up
DOCKER_OPTS="--dns=8.8.8.8 --dns=8.8.4.4"
# to troubleshoot docker in debug mode, fire up the following on command line
docker -dD
# to build a docker image from a Dockerfile
docker build --no-cache=true -t scienceis/shiny-server -f /home/prasanna/scienceis/shiny-server/Dockerfile .
# to save a docker image as a tar file
docker save image-name > image-name.tar
# to load a docker image from a tar file
docker load -i image-name.tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment