This repository has been archived by the owner on Dec 5, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move hack/dockerbuild to docker/build
- Make build image more like km/complete images - Use go docker base image - Change build image name to mesosphere/kubernetes-mesos-build - Increase docker-compose timeouts waiting for apiserver
- Loading branch information
Karl Isenberg
committed
May 28, 2015
1 parent
13b5e41
commit e866b03
Showing
11 changed files
with
114 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
# Installs go into /usr/local/go/bin | ||
# To enable: export PATH=$PATH:/usr/local/go/bin | ||
|
||
GOPATH=${GOPATH:-~/go} | ||
GO_ARCHIVE_URL=${GO_ARCHIVE_URL:-https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz} | ||
GO_ARCHIVE=/tmp/$(basename ${GO_ARCHIVE_URL}) | ||
set -ex | ||
|
||
echo "Downloading go (${GO_ARCHIVE_URL})..." | ||
mkdir -p $(dirname $GOROOT) | ||
wget -q $GO_ARCHIVE_URL -O $GO_ARCHIVE | ||
echo "Installing go (${GOROOT})..." | ||
tar xf $GO_ARCHIVE -C $(dirname $GOROOT) | ||
GO_VERSION=${GO_VERSION:-1.4.2} | ||
|
||
if [ ! -d $TMPDIR ]; then | ||
mkdir -p $TMPDIR | ||
archive_root=go${GO_VERSION}.linux-amd64 | ||
archive_url=https://storage.googleapis.com/golang/${archive_root}.tar.gz | ||
|
||
cd /usr/local | ||
|
||
if [ -d ./go ]; then | ||
echo "Uninstalling Go..." | ||
rm -rf ./go | ||
fi | ||
|
||
rm -f $GO_ARCHIVE | ||
echo "Downloading Go..." | ||
wget -nv ${archive_url} -O ${archive_root}.tar.gz | ||
|
||
echo "Installing Go..." | ||
tar xf ${archive_root}.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM golang:1.4.2-wheezy | ||
MAINTAINER Mesosphere <support@mesosphere.io> | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ | ||
wget \ | ||
curl \ | ||
g++ \ | ||
make \ | ||
mercurial \ | ||
git \ | ||
rsync \ | ||
patch \ | ||
&& \ | ||
apt-get clean | ||
|
||
COPY ./docker/bin/* /kubernetes-mesos/bin/ | ||
COPY ./docker/build/bin/* /kubernetes-mesos/bin/ | ||
ENV PATH /kubernetes-mesos/bin:$PATH | ||
|
||
RUN go get github.com/tools/godep | ||
|
||
VOLUME /target | ||
CMD [ ] | ||
|
||
# optional: if $SNAP is host-volume-mounted into the container at run-time then | ||
# use that as the project source code repo instead of github | ||
ENV SNAP /snapshot | ||
ENTRYPOINT [ "km-build" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
# paths relative to project dir | ||
EXPECTED_SCRIPT_DIR=docker/build | ||
EXPECTED_BINARY_DIR=bin | ||
|
||
set -ex | ||
|
||
script_dir=$(cd $(dirname $0) && pwd -P) | ||
|
||
# defence against lazy refactoring | ||
[[ "$script_dir" != *"$EXPECTED_SCRIPT_DIR" ]] && echo "Build script has moved! Expected location: $EXPECTED_SCRIPT_DIR" && exit 1 | ||
|
||
project_dir=$(cd "${script_dir}/../.." && pwd -P) | ||
cd ${project_dir} | ||
|
||
# create temp dir in project dir to avoid permission issues | ||
WORKSPACE=$(env TMPDIR=$PWD mktemp -d -t "k8sm-workspace") | ||
echo "Workspace created: $WORKSPACE" | ||
|
||
cleanup() { | ||
rm -rf ${WORKSPACE} | ||
echo "Workspace deleted: $WORKSPACE" | ||
} | ||
trap 'cleanup' EXIT | ||
|
||
mkdir ${WORKSPACE}/bin | ||
|
||
# setup workspace to mirror project dir (for resources required by the dockerfile) | ||
echo "Setting up workspace" | ||
mkdir -p ${WORKSPACE}/docker/bin | ||
cp ${project_dir}/docker/bin/* ${WORKSPACE}/docker/bin/ | ||
mkdir -p ${WORKSPACE}/docker/build/bin | ||
cp ${project_dir}/docker/build/bin/* ${WORKSPACE}/docker/build/bin/ | ||
|
||
# Dockerfile must be within build context | ||
cp ${project_dir}/${EXPECTED_SCRIPT_DIR}/Dockerfile ${WORKSPACE}/ | ||
|
||
cd ${WORKSPACE} | ||
|
||
# build docker image | ||
echo "Building kubernetes-mesos-build docker image" | ||
docker build -t mesosphere/kubernetes-mesos-build . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.