deis/docker-swift-onlyone

Name: docker-swift-onlyone

Owner: Deis

Description: Dockerfile to create an OpenStack Swift installation with only one replica

Forked from: ccollicutt/docker-swift-onlyone

Created: 2016-07-08 16:20:59.0

Updated: 2016-07-08 16:21:00.0

Pushed: 2016-07-08 19:32:52.0

Homepage: null

Size: 20

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Docker OpenStack Swift onlyone

Simple deployment of a “all in one” style OpenStack Swift server, uses Ubuntu packages as opposed to source.

Makefile and swiftrc

There is a makefile with some useful helper commands, as well as a swiftrc file that you can use as well which shorts the swift command as well as adds a function to set a container to be a public, listable html page.

Usage

I suggest using the data container methodology.

So first we create a data only container for /srv.

ant@host1:~$ docker run -v /srv --name SWIFT_DATA busybox

Now that we have a data container, we can use the “–volumes-from” option when creating the “onlyone” container. Note that in this case I've called the image built from this docker file “curtis/swift-onlyone”.

ant@host1:~$ ID=$(docker run --name onlyone --hostname onlyone -d -p 12345:8080 --volumes-from SWIFT_DATA -t curtis/swift-onlyone)

With that container running we can now check the logs.

ant@host1:~$ docker logs $ID
ce d0r1z1-127.0.0.1:6010R127.0.0.1:6010/sdb1_"" with 1.0 weight got id 0
signed 128 (100.00%) partitions. Balance is now 0.00.
ce d0r1z1-127.0.0.1:6011R127.0.0.1:6011/sdb1_"" with 1.0 weight got id 0
signed 128 (100.00%) partitions. Balance is now 0.00.
ce d0r1z1-127.0.0.1:6012R127.0.0.1:6012/sdb1_"" with 1.0 weight got id 0
signed 128 (100.00%) partitions. Balance is now 0.00.
ING: Unable to modify file descriptor limit.  Running as non-root?
ting proxy-server...(/etc/swift/proxy-server.conf)
ting container-server...(/etc/swift/container-server.conf)
ting account-server...(/etc/swift/account-server.conf)
ting object-server...(/etc/swift/object-server.conf)
ING: Unable to modify file descriptor limit.  Running as non-root?
ting container-updater...(/etc/swift/container-server.conf)
ting account-auditor...(/etc/swift/account-server.conf)
ting object-replicator...(/etc/swift/object-server.conf)
ting container-replicator...(/etc/swift/container-server.conf)
ting object-auditor...(/etc/swift/object-server.conf)
le to locate config for object-expirer
ting container-auditor...(/etc/swift/container-server.conf)
ting account-replicator...(/etc/swift/account-server.conf)
ting account-reaper...(/etc/swift/account-server.conf)
ting container-sync...(/etc/swift/container-server.conf)
ting object-updater...(/etc/swift/object-server.conf)
ting to tail /var/log/syslog...(hit ctrl-c if you are starting the container in a bash shell)

At this point OpenStack Swift is running.

ant@host1:~$ docker ps
AINER ID        IMAGE                         COMMAND                CREATED             STATUS              PORTS                     NAMES
f8cd8b48        curtis/swift-onlyone:latest   /bin/sh -c /usr/loca   58 seconds ago      Up 57 seconds       0.0.0.0:12345->8080/tcp   hopeful_brattain

We can now use the swift python client to access Swift using the Docker forwarded port, in this example port 12345.

ant@host1:~$ swift -A http://127.0.0.1:12345/auth/v1.0 -U test:tester -K testing stat
   Account: AUTH_test
Containers: 0
   Objects: 0
     Bytes: 0
ntent-Type: text/plain; charset=utf-8
-Timestamp: 1402463864.77057
X-Trans-Id: tx4e7861ebab8244c09dad9-005397e678
t-Timestamp: 1402463864.77057

Try uploading a file:

ant@host1:~$ swift -A http://127.0.0.1:12345/auth/v1.0 -U test:tester -K testing upload swift swift.txt
t.txt

That's it!

Todo

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.