Browse Source

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
Eugene Yakubovich 10 years ago
parent
commit
80d96d74e5
3 changed files with 10 additions and 2 deletions
  1. 1 1
      Dockerfile
  2. 9 1
      dist/build-docker.sh
  3. 0 0
      dist/publish.sh

+ 1 - 1
Dockerfile

@@ -1 +1 @@
-FROM golang:onbuild
+FROM golang:1.4.1-onbuild

+ 9 - 1
dist/build-docker → 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 <<DF >${tgt}/Dockerfile
 FROM quay.io/coreos/flannelbox:1.0
 MAINTAINER Eugene Yakubovich <eugene.yakubovich@coreos.com>
@@ -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

+ 0 - 0
dist/publish → dist/publish.sh