rely on build-args

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
diff --git a/weekly.sh b/weekly.sh
index 2c20996..0bdcb16 100755
--- a/weekly.sh
+++ b/weekly.sh
@@ -9,12 +9,13 @@
 JENKINS_SHA=`curl http://repo.jenkins-ci.org/simple/releases/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war.sha1`
 echo $JENKINS_SHA
 
-sed -e "s/ENV JENKINS_VERSION .*/ENV JENKINS_VERSION $JENKINS_VERSION/g" -e "s/ENV JENKINS_SHA .*/ENV JENKINS_SHA $JENKINS_SHA/g" Dockerfile > Dockerfile.$JENKINS_VERSION
+docker build --build-arg JENKINS_VERSION=$JENKINS_VERSION \
+             --build-arg JENKINS_SHA=$JENKINS_SHA \
+             --tag jenkinsci/jenkins:$JENKINS_VERSION .
 
-docker build -f Dockerfile.$JENKINS_VERSION -t jenkinsci/jenkins:$JENKINS_VERSION .
+docker tag jenkinsci/jenkins:$JENKINS_VERSION jenkinsci/jenkins:latest
+
 docker push jenkinsci/jenkins:$JENKINS_VERSION
-
-docker build -f Dockerfile.$JENKINS_VERSION -t jenkinsci/jenkins:latest .
 docker push jenkinsci/jenkins:latest