mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-19 20:26:54 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b1acd0a7b0 | |||
| 8be58d3a7f | |||
| c5051ea0ea | |||
| 33c2f07fc7 | |||
| 1480bff3a9 | |||
| ac7fa37be3 | |||
| 065eca9d4e | |||
| 6316b99556 | |||
| bb9ce6b287 | |||
| a3ca3e9218 | |||
| a030c1bd24 | |||
| 4a1c40364c | |||
| 4015f8dd34 | |||
| 16f132b156 |
@@ -14,7 +14,7 @@ TMPDIR=$(shell mktemp -d -t XXXXXX)
|
||||
|
||||
|
||||
# Build a debian source package
|
||||
all: build_in_deb
|
||||
all: clean build_in_deb
|
||||
|
||||
build_in_deb:
|
||||
echo "GOPATH = " $(ROOT_PATH)
|
||||
@@ -29,7 +29,7 @@ install:
|
||||
install -m 0755 bin/docker $(DESTDIR)/$(INSDIR)
|
||||
install -o root -m 0755 etc/docker.upstart $(DESTDIR)/etc/init/docker.conf
|
||||
|
||||
$(BUILD_SRC): cleanup
|
||||
$(BUILD_SRC): clean
|
||||
# Copy ourselves into $BUILD_SRC to comply with unusual golang constraints
|
||||
tar --exclude=*.tar.gz --exclude=checkout.tgz -f checkout.tgz -cz *
|
||||
mkdir -p $(BUILD_SRC)/$(GITHUB_PATH)
|
||||
@@ -79,6 +79,5 @@ gotest:
|
||||
done
|
||||
@sudo rm -rf /tmp/docker-*
|
||||
|
||||
cleanup:
|
||||
|
||||
rm -rf $(BUILD_PATH) debian/$(PKG_NAME)* debian/files $(BUILD_SRC) checkout.tgz
|
||||
clean:
|
||||
rm -rf $(BUILD_PATH) debian/$(PKG_NAME)* debian/files $(BUILD_SRC) checkout.tgz bin
|
||||
|
||||
@@ -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?
|
||||
=============================
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import (
|
||||
const CONFIGFILE = "/var/lib/docker/.dockercfg"
|
||||
|
||||
// the registry server we want to login against
|
||||
const REGISTRY_SERVER = "http://registry.docker.io"
|
||||
const REGISTRY_SERVER = "https://registry.docker.io"
|
||||
|
||||
type AuthConfig struct {
|
||||
Username string `json:"username"`
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const VERSION = "0.0.2"
|
||||
const VERSION = "0.0.3"
|
||||
|
||||
func (srv *Server) Name() string {
|
||||
return "docker"
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user