A few reasons why you could run a Docker Registry

Quick start into running and using a Registry

I recently started using the Docker Registry. as I had a need to store sensitive data; read only deploy keys.

I tried building the image myself and it worked; but I wondered why do I have to build it? So after reviewing a few blog posts I realized I could override almost everything I could dream of without needing to build the image myself. So in an overall attempt to reduce the steps required to produce a registry server I used the stackbrew/registry.

docker run -e SETTINGS_FLAVOR=dev -d -v /registry:/tmp/registry -p stackbrew/registry

This binds the registry to localhost:5000 on the server; so in order to access this remotely you need an SSH Tunnel.

ssh ip -L 5000:localhost:5000 -N -f

  • How do you referece in your Dockerfile that you are using a private registry? FROM localhost:5000/coreos/etcd

  • How do you get your Images into the private regstry?

    There are 2 ways you can push an image to your registry.

    1. docker tag

      docker tag af267c0422b8 localhost:5000/coreos/etcd

    2. docker build

      docker build -t localhost:5000/damm/redis:0.0.1 -t localhost:5000/damm/redis:latest git://github.com/damm/docker-redis.git

    Once the image is tagged to your registry you can push it with the docker push command

    docker push localhost:5000/coreos/etcd

    Let's say you need to tag it as a version and latest?

    docker tag af267c0422b8 localhost:5000/coreos/etcd:0.0.1

    docker tag af267c0422b8 localhost:5000/coreos/etcd:latest

    docker push localhost:5000/coreos/etcd

    Pushing tag for rev [af267c0422b8] on {http://localhost:5000/v1/repositories/coreos/etcd/tags/0.0.1}

    Pushing tag for rev [af267c0422b8] on {http://localhost:5000/v1/repositories/coreos/etcd/tags/latest}

Final Words. Using the Registry can give you many benefits; or very little depending on how you use it.
  1. Private registry to store your sensitive data that you don't want out in the world.

  2. Tag your volumes to the registry and back them up to S3 for backup purposes.

  3. Quick and easy way to share your images with a few friends; but not the world.

more ...

Logstash Using Docker

I was spending some time refining my complex Logstash configuration driven by Chef; I quickly began to realize how hard it could be to make it dynamic. As I have been using Docker for hosting Uptime. I decided to look upon this as an opportunity and built 3 Docker images ...

more ...

Simple quick tips i've learned using Docker

Quick Tips for Docker

I originally started using Docker shortly after _0.6.0_ was released. A lot has changed since then and for the most part; all the better. But there are many things I wish someone had told me when I started using [Docker][docker].

  • Persistence Nothing removed unless you tell Docker to. + Volumes are fantastic; but unless you start your containers with the -rm flag your data should not disappear magically. You will have to _inspect_ the old _container_ that was running to determine where the root filesystem is, but it's there.

  • Building images can make a lot of containers that _can_ and _do_ waste a lot of space. + Using docker build -rm will save you a lot of disk space. + If the exit command does not exit succesfully the container; it will not be used as cache in the future. This can lead to wasting time building images as you have to re-download Java each time you build.

  • Networking You can accept the default setup where Docker creates docker0 or you can configure your own Bridge and configure docker to use that instead. + Modify $DOCKER_OPTS to look like: DOCKER_OPTS="-api-enable-cors=true -b=br0 -H=tcp://x.x.x.x:4243 -H=unix:///var/run/docker.sock"

  • Help Diagnose Problems If you get stuck with something; you can share your _image_ with peers to help you diagnose the problem. They can then either tell you what they did to fix your image or send you the fixed _image_.

more ...