File tree Expand file tree Collapse file tree 7 files changed +58
-77
lines changed Expand file tree Collapse file tree 7 files changed +58
-77
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ $ docker run --rm --privileged -it dockerswarm/dind:1.0.0 docker version
2222Client version: 1.0.0 
2323``` 
2424
25- ## Tools  
25+ ## Build  
2626
27- ##  build_and_push.sh 
28- 
29- Build and push the given Docker images. If not arguments are given, it will build and push  ** all **  images. 
27+ ``` 
28+ ./build.sh VERSION 
29+ ``` 
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set  -e
3+ 
4+ if  [[ -z  " $1 "   ]];  then 
5+     >&2  echo  " Usage: $( basename $0 )   <version>" 
6+     exit  1
7+ fi 
8+ 
9+ VERSION=$1 
10+ docker build --build-arg=VERSION=$VERSION  -t dockerswarm/dind:$VERSION  . 
  Load Diff This file was deleted. 
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # 
3+ #  Check for new docker versions. Build and push an image for the latest
4+ #  version if it doesn't already exist.
5+ # 
6+ 
7+ set  -e
8+ 
9+ DOCKER_REPOSITORY=https://github.com/docker/docker.git
10+ 
11+ MIN_DOCKER_VERSION_TAG=${MIN_DOCKER_VERSION_TAG-" v1.8.2"  } 
12+ 
13+ DOCKER_IMAGE=${DOCKER_IMAGE:- dockerswarm/ dind} 
14+ 
15+ #  Sort versions correctly with rc releases. This will break if there
16+ #  are more than 9 bug fix releases in a minor version
17+ function  tags_after()  {
18+     local  min_version=$1 
19+     sort -t" ."   -k " 1,3.1Vr"   -k " 3.2,3.2"   |  \
20+     sed " /^${min_version} \$ /q"   |  \
21+     sort -t" ."   -k " 1,3.1V"    -k " 3.2,3.2r" 
22+ }
23+ 
24+ #  Docker version tags starting from MIN_VERSION
25+ latest=$( 
26+     git ls-remote --tags $DOCKER_REPOSITORY  v\*  |  
27+     awk -F' /'   ' { print $3 }'   |  
28+     grep -v " \^{}"   |  
29+     tags_after $MIN_DOCKER_VERSION_TAG  |  
30+     tail -1 |  
31+     sed " s/^v//"  
32+ ) 
33+ 
34+ image=" ${DOCKER_IMAGE} :${latest} " 
35+ 
36+ if  docker pull $image ;  then 
37+     echo  " Version $latest  already exists." 
38+     exit 
39+ fi 
40+ 
41+ echo  " Building version $latest " 
42+ ./build.sh $latest 
43+ docker push $image 
Original file line number Diff line number Diff line change 1212    HOST=get.docker.com
1313fi 
1414
15- curl -L -f -s - o /usr/local/bin/docker \
15+ curl -L -f -o /usr/local/bin/docker \
1616    https://$HOST /builds/Linux/x86_64/docker-${VERSION} 
1717
1818chmod +x /usr/local/bin/docker
  Load Diff This file was deleted. 
  Load Diff This file was deleted. 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments