Add cleanup/refactor portion of #2010 for hack and Dockerfile updates
This commit is contained in:
parent
ff85031980
commit
ccefe47897
32
Dockerfile
32
Dockerfile
|
@ -16,43 +16,53 @@
|
||||||
#
|
#
|
||||||
# # Publish a release:
|
# # Publish a release:
|
||||||
# docker run -privileged -lxc-conf=lxc.aa_profile=unconfined \
|
# docker run -privileged -lxc-conf=lxc.aa_profile=unconfined \
|
||||||
# -e AWS_S3_BUCKET=baz \
|
# -e AWS_S3_BUCKET=baz \
|
||||||
# -e AWS_ACCESS_KEY=foo \
|
# -e AWS_ACCESS_KEY=foo \
|
||||||
# -e AWS_SECRET_KEY=bar \
|
# -e AWS_SECRET_KEY=bar \
|
||||||
# -e GPG_PASSPHRASE=gloubiboulga \
|
# -e GPG_PASSPHRASE=gloubiboulga \
|
||||||
# -lxc-conf=lxc.aa_profile=unconfined -privileged docker hack/release.sh
|
# docker hack/release.sh
|
||||||
#
|
#
|
||||||
|
|
||||||
docker-version 0.6.1
|
docker-version 0.6.1
|
||||||
from ubuntu:12.04
|
from ubuntu:12.04
|
||||||
maintainer Solomon Hykes <solomon@dotcloud.com>
|
maintainer Solomon Hykes <solomon@dotcloud.com>
|
||||||
|
|
||||||
# Build dependencies
|
# Build dependencies
|
||||||
run echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list
|
run echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list
|
||||||
run apt-get update
|
run apt-get update
|
||||||
run apt-get install -y -q curl
|
run apt-get install -y -q curl
|
||||||
run apt-get install -y -q git
|
run apt-get install -y -q git
|
||||||
run apt-get install -y -q mercurial
|
run apt-get install -y -q mercurial
|
||||||
# Install Go
|
run apt-get install -y -q build-essential
|
||||||
run curl -s https://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz | tar -v -C /usr/local -xz
|
|
||||||
env PATH /usr/local/go/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
# Install Go from source (for eventual cross-compiling)
|
||||||
env GOPATH /go:/go/src/github.com/dotcloud/docker/vendor
|
|
||||||
env CGO_ENABLED 0
|
env CGO_ENABLED 0
|
||||||
run cd /tmp && echo 'package main' > t.go && go test -a -i -v
|
run curl -s https://go.googlecode.com/files/go1.1.2.src.tar.gz | tar -v -C / -xz && mv /go /goroot
|
||||||
|
run cd /goroot/src && ./make.bash
|
||||||
|
env GOROOT /goroot
|
||||||
|
env PATH $PATH:/goroot/bin
|
||||||
|
env GOPATH /go:/go/src/github.com/dotcloud/docker/vendor
|
||||||
|
|
||||||
# Ubuntu stuff
|
# Ubuntu stuff
|
||||||
run apt-get install -y -q ruby1.9.3 rubygems libffi-dev
|
run apt-get install -y -q ruby1.9.3 rubygems libffi-dev
|
||||||
run gem install fpm
|
run gem install --no-rdoc --no-ri fpm
|
||||||
run apt-get install -y -q reprepro dpkg-sig
|
run apt-get install -y -q reprepro dpkg-sig
|
||||||
|
|
||||||
# Install s3cmd 1.0.1 (earlier versions don't support env variables in the config)
|
# Install s3cmd 1.0.1 (earlier versions don't support env variables in the config)
|
||||||
run apt-get install -y -q python-pip
|
run apt-get install -y -q python-pip
|
||||||
run pip install s3cmd
|
run pip install s3cmd
|
||||||
run pip install python-magic
|
run pip install python-magic
|
||||||
run /bin/echo -e '[default]\naccess_key=$AWS_ACCESS_KEY\nsecret_key=$AWS_SECRET_KEY\n' > /.s3cfg
|
run /bin/echo -e '[default]\naccess_key=$AWS_ACCESS_KEY\nsecret_key=$AWS_SECRET_KEY\n' > /.s3cfg
|
||||||
|
|
||||||
# Runtime dependencies
|
# Runtime dependencies
|
||||||
run apt-get install -y -q iptables
|
run apt-get install -y -q iptables
|
||||||
run apt-get install -y -q lxc
|
run apt-get install -y -q lxc
|
||||||
|
|
||||||
volume /var/lib/docker
|
volume /var/lib/docker
|
||||||
workdir /go/src/github.com/dotcloud/docker
|
workdir /go/src/github.com/dotcloud/docker
|
||||||
|
|
||||||
# Wrap all commands in the "docker-in-docker" script to allow nested containers
|
# Wrap all commands in the "docker-in-docker" script to allow nested containers
|
||||||
entrypoint ["hack/dind"]
|
entrypoint ["hack/dind"]
|
||||||
|
|
||||||
# Upload docker source
|
# Upload docker source
|
||||||
add . /go/src/github.com/dotcloud/docker
|
add . /go/src/github.com/dotcloud/docker
|
||||||
|
|
|
@ -25,9 +25,9 @@ set -e
|
||||||
# but really, they shouldn't. We want to be in a container!
|
# but really, they shouldn't. We want to be in a container!
|
||||||
RESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
|
RESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
|
||||||
grep -q "$RESOLVCONF" /proc/mounts || {
|
grep -q "$RESOLVCONF" /proc/mounts || {
|
||||||
echo "# WARNING! I don't seem to be running in a docker container."
|
echo >&2 "# WARNING! I don't seem to be running in a docker container."
|
||||||
echo "# The result of this command might be an incorrect build, and will not be officially supported."
|
echo >&2 "# The result of this command might be an incorrect build, and will not be officially supported."
|
||||||
echo "# Try this: 'docker build -t docker . && docker run docker ./hack/make.sh'"
|
echo >&2 "# Try this: 'docker build -t docker . && docker run docker ./hack/make.sh'"
|
||||||
}
|
}
|
||||||
|
|
||||||
# List of bundles to create when no argument is passed
|
# List of bundles to create when no argument is passed
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
DEST=$1
|
DEST=$1
|
||||||
|
|
||||||
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS" ./docker
|
if go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS" ./docker; then
|
||||||
|
echo "Created binary: $DEST/docker-$VERSION"
|
||||||
echo "Created binary: $DEST/docker-$VERSION"
|
fi
|
||||||
|
|
Loading…
Reference in New Issue