Distributing Images

Michael Sevilla edited this page Sep 5, 2016 · 5 revisions

Distributing Images

You've made a Docker image from the Quickstart and now you want to share it with your cluster.

Using Dockerhub

Dockerhub is public and adheres to the Popper Convention.

  1. Tag your image:

    docker tag mantle:latest michaelsevilla/mantle:jewel
  2. Login to Dockerhub:

    $ docker login
    ...
    Login Succeeded
  3. Push your image:

    docker push michaelsevilla/mantle:jewel

Using an Internal Registry

An in-house Docker image registry is faster than Dockerhub but it's much harder to Popperize.

  1. Start up the registry:

    docker run -d \
      -p 5000:5000 \
      --restart=always \
      --name registry \
      -v $PWD/data:/var/lib/registry \
      registry:2
  2. Tag the image:

    docker tag mantle:latest $REGISTRY_IP:5000/michaelsevilla/mantle:jewel
  3. Push your image to the registry:

    docker push $REGISTRY_IP:5000/michaelsevilla/mantle:jewel

    If you get an error:

    $ docker push $REGISTRY_IP:5000/michaelsevilla/mds-reqlatency
    The push refers to a repository [192.168.140.2:5000/michaelsevilla/mds-reqlatency]
    Get https://192.168.140.2:5000/v1/_ping: tls: oversized record received with length 20527

    You might have to instruct the daemon to use an insecure registry in /etc/docker/daemon.json:

    {
        "insecure-registries": ["192.168.140.2:5000"]
    }
  4. Check out your image sitting in the registry:

    $ curl -X GET http://$REGISTRY_IP:5000/v2/_catalog | python -m json.tool
    {
        "repositories": [
            "michaelsevilla/mantle"
        ]
    }
  5. On all nodes, add this to the end of /etc/default/docker:

    DOCKER_OPTS=--insecure-registry=$REGISTRY_IP:5000
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.