Skip navigation

Docker Reference Guide

Posted by tejones Mar 31, 2017

This blog will capture and document common Docker commands. I'll try to keep them in a logical flow so you don't have to jump around. This is for me as much as it is for you.


If you have suggestions for other commands, please leave in comments. Also, if I am wrong about something, please point it out and I will correct it. If you have a lot of really good info, I may even give you edit rights.




How to get an image locally?

docker pull {dockerimage} - pulls a docker image down to your local docker registry.


How to add an insecure registry to docker?

vi /etc/sysconfig/docker - opens docker configuration for editing (may need sudo).

Add your registry:

# If you have a registry secured with https but do not have proper certs

# distributed, you can tell docker to not look for full authorization by

# adding the registry to the INSECURE_REGISTRY line and uncommenting it.

INSECURE_REGISTRY='--insecure-registry --insecure-registry --insecure-registry localhost:5000 --insecure-registry'


How to run an image?


There are a lot of options available, here is an example I use most often.

docker run -it -p 8080:8080 -p 8443:8443 -p 9990:9990 -p 31000:31000 {docker_image}


How to get ips for Docker images?

There are a few ways to go about this, but this seems the easiest easiest assuming your docker is using a network bridge (the default):

docker network inspect bridge

will output something like this:



        "Name": "bridge",

        "Id": "101764200e68e573306bf799e0b7ed04ca03db8a4bb4c5f9a98bbf8f8a6de8dc",

        "Scope": "local",

        "Driver": "bridge",

        "EnableIPv6": false,

        "IPAM": {

            "Driver": "default",

            "Options": null,

            "Config": [


                    "Subnet": "",

                    "Gateway": ""




        "Internal": false,

        "Containers": {

            "280062f9a863983516ebe80b9aba9e507351cb0c85bb7b5d53dfc0473df8247b": {

                "Name": "naughty_liskov",

                "EndpointID": "91b6c2b270d72b2e48255d66580aaecfd3029dd7dc7fab4e52b369f412e9c634",

                "MacAddress": "02:42:ac:11:00:02",

                "IPv4Address": "",

                "IPv6Address": ""



        "Options": {

            "": "true",

            "": "true",

            "": "true",

            "": "",

            "": "docker0",

            "": "1500"


        "Labels": {}





More to come...

Filter Blog

By date:
By tag: