From 80d96d74e5442536e28fb36440dae894b2f38a44 Mon Sep 17 00:00:00 2001 From: Eugene Yakubovich Date: Wed, 11 Feb 2015 16:31:05 -0800 Subject: [PATCH] build/dist maintenance - Move Dockerfile build to Go 1.4.1 - Rename bash scripts to have .sh ext - build-docker.sh build the actual binary as well now --- Dockerfile | 2 +- dist/{build-docker => build-docker.sh} | 10 +++++++++- dist/{publish => publish.sh} | 0 3 files changed, 10 insertions(+), 2 deletions(-) rename dist/{build-docker => build-docker.sh} (60%) rename dist/{publish => publish.sh} (100%) diff --git a/Dockerfile b/Dockerfile index 464c7fd32f..6f9681052e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1 @@ -FROM golang:onbuild +FROM golang:1.4.1-onbuild diff --git a/dist/build-docker b/dist/build-docker.sh similarity index 60% rename from dist/build-docker rename to dist/build-docker.sh index 83f78c3cf5..48aa840b73 100755 --- a/dist/build-docker +++ b/dist/build-docker.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e if [ $# -ne 1 ]; then echo "Usage: $0 tag" >/dev/stderr @@ -9,6 +10,10 @@ tag=$1 tgt=$(mktemp -d) +# Build flannel inside +docker run -v `pwd`/../:/opt/flannel -i -t golang:1.4.1 /bin/bash -c "cd /opt/flannel && ./build" + +# Generate Dockerfile into target tmp dir cat <${tgt}/Dockerfile FROM quay.io/coreos/flannelbox:1.0 MAINTAINER Eugene Yakubovich @@ -17,7 +22,10 @@ ADD ./mk-docker-opts.sh /opt/bin/ CMD /opt/bin/flanneld DF +# Copy artifcats into target dir and build the image cp ../bin/flanneld $tgt -cp ../dist/mk-docker-opts.sh $tgt +cp ./mk-docker-opts.sh $tgt docker build -t quay.io/coreos/flannel:${tag} $tgt + +# Cleanup rm -rf $tgt diff --git a/dist/publish b/dist/publish.sh similarity index 100% rename from dist/publish rename to dist/publish.sh