Before modern-day shipping, packing and transporting different shaped boxes and other oddly shaped items from ships to trucks to warehouses was difficult, inefficient, and cumbersome. That was until the modern day shipping container was introduced to the industry. These containers could easily be stacked and organized onto a cargo ship then easily transferred to a truck where it would be sent on to its final destination. Solomon Hykes, Docker founder and CTO, likens the Docker to the modern-day shipping industry’s solution for shipping goods. Docker utilizes containerization for shipping software.
Docker, an open platform for distributed applications used by developers and system administrators, leverages standard Linux container technologies and some
git-inspired image management technology. Users can create containers that have everything they need to run an application just like a virtual server but are much lighter to deploy and manage. Each container has all the binaries it needs including library and middleware, configuration, and activation process. The containers can be moved around [like containers on ships] and executed in any Docker-enabled server.
Container images are built and maintained using deltas, which can be used by several other images. Sharing reduces the overall size and allows for easy image storage in Docker registries [like containers on ships]. Any user with access to the registry can download the image and activate it on any server with a couple of commands. Some organizations have development teams that build the images, which are run by their operations teams.
Docker & SoftLayer
While many people share images on the public Docker registry, security-minded organizations will want to create a private registry by leveraging SoftLayer object storage. You can create Docker images for a private registry that will store all its information with object storage. Registries are then easy to create and move to new hosts or between data centers.
Creating a Private Docker Registry on SoftLayer
Optional setup step: Change Docker backend storage AuFS
- Install the following package to enable AuFS:
apt-get install linux-image-extra-3.13.0-36-generic
/etc/init/docker.conf, and add the following line or argument:
- Restart Docker, and check if the backend was changed:
service docker restart
The command should indicate AuFS is being used. The output should look similar to the following:
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Execution Driver: native-0.2
Kernel Version: 3.13.0-36-generic
WARNING: No swap limit support
Step 1: Create image repo
- Create the directory
registry-osin a work directory.
- Create a file named
registry-osdirectory. It should contain the following code:
# start from a registry release known to work
# get the swift driver for the registry
RUN pip install docker-registry-driver-swift==0.0.1
# SoftLayer uses v1 auth and the sample config doesn't have an option
# for it so inject one
RUN sed -i '91i\ swift_auth_version: _env:OS_AUTH_VERSION' /docker-registry/config/config_sample.yml
- Execute the following command from the directory that contains the
registry-osdirectory to build the registry container:
docker build -t registry-swift:0.7.3 registry-os
Step 2: Start it with your object storage credential
docker run -it -d -e SETTINGS_FLAVOR=swift -e
layer.com/auth/v1.0' -e OS_AUTH_VERSION=1 -e
OS_CONTAINER='docker' -e GUNICORN_WORKERS=8 -p
This example assumes we are storing images in DAL05 on a container called
API_KEYare the object storage credentials you can obtain from the portal.
Step 3: Push image
docker tag registry-swift:0.7.3 localhost:5000/registry-swift
docker push localhost:5000/registry-swift
You can ensure that it worked by inspecting the contents of the container in the object storage.
Step 4: Get image
docker pull localhost:5000/registry-swift
Images can be downloaded from other servers by replacing localhost with the IP address to the registry server.
The Docker container can be pushed throughout your infrastructure once you have created your private registry. Failure of the machine that contains the registry can be quickly mitigated by restarting the image on another node. To restart the image, make sure it’s on more than one node in the registry allowing you to leverage the SoftLayer platform and the high durability of object storage.