Compare commits

...

8 Commits

Author SHA1 Message Date
Solomon Hykes
33c2f07fc7 Bumped version to 0.0.3 2013-03-18 00:35:48 -07:00
Solomon Hykes
1480bff3a9 Contributing to Docker 2013-03-17 19:32:06 -07:00
Solomon Hykes
ac7fa37be3 Moved Ubuntu install to the top 2013-03-17 19:10:47 -07:00
Solomon Hykes
065eca9d4e Docker: the Linux container runtime 2013-03-17 19:09:51 -07:00
Solomon Hykes
a030c1bd24 Removed out-of-date examples directory (see README and the wiki for examples) 2013-03-16 18:36:52 -07:00
Solomon Hykes
4a1c40364c Removed redundant file used by debian packaging 2013-03-16 18:35:43 -07:00
Solomon Hykes
4015f8dd34 Merge pull request #101 from silas/examples
Fix docker run typo
2013-03-16 18:32:26 -07:00
Silas Sewell
16f132b156 Fix docker run typo 2013-03-16 16:16:13 -04:00
4 changed files with 82 additions and 119 deletions

116
README.md
View File

@@ -1,7 +1,7 @@
Docker is a process manager with superpowers
============================================
Docker: the Linux container runtime
===================================
It encapsulates heterogeneous payloads in Standard Containers, and runs them on any server with strong guarantees of isolation and repeatability.
Docker complements LXC with a high-level API with operates at the process level. It runs unix processes with strong guarantees of isolation and repeatability across servers.
Is is a great building block for automating distributed systems: large-scale web deployments, database clusters, continuous deployment systems, private PaaS, service-oriented architectures, etc.
@@ -53,37 +53,6 @@ Under the hood, Docker is built on the following components:
Install instructions
==================
Installing with Vagrant
-----------------------
Currently, Docker can be installed with Vagrant both on your localhost
with VirtualBox as well as on Amazon EC2. Vagrant 1.1 is required for
EC2, but deploying is as simple as:
```bash
$ export AWS_ACCESS_KEY_ID=xxx \
AWS_SECRET_ACCESS_KEY=xxx \
AWS_KEYPAIR_NAME=xxx \
AWS_SSH_PRIVKEY=xxx
$ vagrant plugin install vagrant-aws
$ vagrant up --provider=aws
```
The environment variables are:
* `AWS_ACCESS_KEY_ID` - The API key used to make requests to AWS
* `AWS_SECRET_ACCESS_KEY` - The secret key to make AWS API requests
* `AWS_KEYPAIR_NAME` - The name of the keypair used for this EC2 instance
* `AWS_SSH_PRIVKEY` - The path to the private key for the named keypair
For VirtualBox, you can simply ignore setting any of the environment
variables and omit the ``provider`` flag. VirtualBox is still supported with
Vagrant <= 1.1:
```bash
$ vagrant up
```
Installing on Ubuntu 12.04 and 12.10
------------------------------------
@@ -119,6 +88,38 @@ Right now, the officially supported distributions are:
Docker probably works on other distributions featuring a recent kernel, the AUFS patch, and up-to-date lxc. However this has not been tested.
Installing with Vagrant
-----------------------
Currently, Docker can be installed with Vagrant both on your localhost
with VirtualBox as well as on Amazon EC2. Vagrant 1.1 is required for
EC2, but deploying is as simple as:
```bash
$ export AWS_ACCESS_KEY_ID=xxx \
AWS_SECRET_ACCESS_KEY=xxx \
AWS_KEYPAIR_NAME=xxx \
AWS_SSH_PRIVKEY=xxx
$ vagrant plugin install vagrant-aws
$ vagrant up --provider=aws
```
The environment variables are:
* `AWS_ACCESS_KEY_ID` - The API key used to make requests to AWS
* `AWS_SECRET_ACCESS_KEY` - The secret key to make AWS API requests
* `AWS_KEYPAIR_NAME` - The name of the keypair used for this EC2 instance
* `AWS_SSH_PRIVKEY` - The path to the private key for the named keypair
For VirtualBox, you can simply ignore setting any of the environment
variables and omit the ``provider`` flag. VirtualBox is still supported with
Vagrant <= 1.1:
```bash
$ vagrant up
```
Usage examples
==============
@@ -144,7 +145,7 @@ Starting a long-running worker process
(docker -d || echo "Docker daemon already running") &
# Start a very useful long-running process
JOB=$(docker run /bin/sh -c "while true; do echo Hello world!; sleep 1; done")
JOB=$(docker run base /bin/sh -c "while true; do echo Hello world!; sleep 1; done")
# Collect the output of the job so far
docker logs $JOB
@@ -179,6 +180,51 @@ Expose a service on a TCP port
echo "Daemon received: $(docker logs $JOB)"
```
Contributing to Docker
======================
Want to hack on Docker? Awesome! Here are instructions to get you started. They are probably not perfect, please let us know if anything feels wrong or incomplete.
Contribution guidelines
-----------------------
### Pull requests are always welcome
We are always thrilled to receive pull requests, and do our best to process them as fast as possible. Not sure if that typo is worth a pull request? Do it! We will appreciate it.
If your pull request is not accepted on the first try, don't be discouraged! If there's a problen with the implementation, hopefully you received feedback on what to improve.
We're trying very hard to keep Docker lean and focused. We don't want it to do everything for everybody. This means that we might decide against incorporating a new feature.
However there might be a way to implement that feature *on top of* docker.
### Discuss your design on the mailing list
We recommend discussing your plans [on the mailing list](https://groups.google.com/forum/?fromgroups#!forum/docker-club) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point
you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing.
### Create issues...
Any significant improvement should be documented as a github issue before anybody start working on it.
### ...but check for existing issues first!
Please take a moment to check that an issue doesn't already exist documenting your bug report or improvement proposal.
If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests.
### Write tests
Golang has a great testing suite built in: use it! Take a look at existing tests for inspiration.
Setting up a dev environment
----------------------------
Coming soon!
What is a Standard Container?
=============================

View File

@@ -23,7 +23,7 @@ import (
"time"
)
const VERSION = "0.0.2"
const VERSION = "0.0.3"
func (srv *Server) Name() string {
return "docker"

View File

@@ -1,10 +0,0 @@
description "Run docker"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
respawn
script
test -f /etc/default/locale && . /etc/default/locale || true
LANG=$LANG LC_ALL=$LANG /usr/bin/docker -d
end script

View File

@@ -1,73 +0,0 @@
#!/usr/bin/env docker -i
# Uncomment to debug:
#set -x
export NORAW=1
IMG=shykes/pybuilder:11d4f58638a72935
if [ $# -lt 3 ]; then
echo "Usage: $0 build|run USER/REPO REV"
echo "Example usage:"
echo ""
echo " REV=7d5f035432fe1453eea389b0f1b02a2a93c8009e"
echo " $0 build shykes/helloflask \$REV"
echo " $0 run shykes/helloflask \$REV"
echo ""
exit 1
fi
CMD=$1
FORCE=0
if [ "$2" = "-f" ]; then
FORCE=1
shift
fi
REPO=$2
REV=$3
BUILD_IMAGE=builds/github.com/$REPO/$REV
if [ "$CMD" = "build" ]; then
if [ ! -z "`images -q $BUILD_IMAGE`" ]; then
if [ "$FORCE" -ne 1 ]; then
echo "$BUILD_IMAGE already exists"
exit
fi
fi
# Allocate a TTY to work around python's aggressive buffering of stdout
BUILD_JOB=`run -t $IMG /usr/local/bin/buildapp http://github.com/$REPO/archive/$REV.tar.gz`
if [ -z "$BUILD_JOB" ]; then
echo "Build failed"
exit 1
fi
if attach $BUILD_JOB ; then
BUILD_STATUS=`docker wait $BUILD_JOB`
if [ -z "$BUILD_STATUS" -o "$BUILD_STATUS" != 0 ]; then
echo "Build failed"
exit 1
fi
else
echo "Build failed"
exit 1
fi
commit $BUILD_JOB $BUILD_IMAGE
echo "Build saved at $BUILD_IMAGE"
elif [ "$CMD" = "run" ]; then
RUN_JOB=`run $BUILD_IMAGE /usr/local/bin/runapp`
if [ -z "$RUN_JOB" ]; then
echo "Run failed"
exit 1
fi
attach $RUN_JOB
fi