Wrong URL for downloading
rtadakam opened this issue · 7 comments
We have a hard coded value for Zookeeper version and we cannot always expect to see the downloadable in 'stable' directory.
3.4.10 version can now be found at : http://www.us.apache.org/dist/zookeeper/zookeeper-3.4.10/
Also, what is the purpose of determining latest zookeeper version in buildDockerImages.pl @ line 193 to 196? I do not see this code snippet get executed when the build script is run while specifically building zookeeper image.
The versions of zookeeper that are available under http://www.us.apache.org/dist/zookeeper/ change as new versions are released. At some point the 3.4.10 version will be removed from http://www.us.apache.org/dist/zookeeper. Because a Weathervane user may build the Docker images at some unknown point in the future, we cannot count on a particular version being available at that time. As a result we always get the version that is available in the stable directory. It may not always be the absolute latest version, but we don't care about that, only that is available for download at that moment (and that it is a stable version).
To manage this, we find the version of Zookeeper in http://www.us.apache.org/dist/zookeeper/stable in the buildDockerImages.pl script. The value is passed to the buildImage method in the list of build args. The buildImage method then passes the build args to the docker build
command as --build-arg parameters. These parameters override the default value given in the ARG instruction in the Dockerfile. As a result, building the Weathervane Docker image for Zookeeper using the buildDockerImages.pl script will always work, even as the available versions change.
More information on using build args in Docker builds can be found here: https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg
Closing this as answered. If I have not answered your question, please re-open and let me know.
I'm sorry, Hal. Though trivial, the issue isn't addressed.
(1) We do have the code to check Apache zookeeper's website to find the latest stable version, but in my case the code path gets skipped. I do not get to see my debug message from below snippet when buildDockerImages.pl is run.
[root@gondor weathervane]# grep --after-context=2 --before-context=2 "RAJESH" buildDockerImages.pl
$zookeeperGet =~ />zookeeper-(\d+.\d+.\d+).tar.gz</;
my $zookeeperVers = $1;
print $fileout "RAJESH: zookeper version to be used is : $zookeeperVers \n";
push @buildArgs, "ZOOKEEPER_VERSION=$zookeeperVers";
} elsif ($imageName eq "tomcat") {
[root@gondor weathervane]#
(2) I do not see any arguments being passed using --build-arg while building the docker image. Following is from my logs while trying to rebuild the zookeeper image:
[root@gondor weathervane]# grep "docker build" *.log
buildDockerImages.log:COMMAND> docker build -t rtadakam/weathervane-zookeeper:1.0.21 ./dockerImages/zookeeper
[root@gondor weathervane]#
I see that zookeeper version getting picked is from :
[root@gondor weathervane]# grep VERSION= dockerImages/zookeeper/Dockerfile
ARG ZOOKEEPER_VERSION=3.4.10
[root@gondor weathervane]#
I do not see relevant code in "rewriteDockerfile " routine of buildDockerImages.pl that would change the version of zookeeper.
Can you please attach the buildDockerImages.log file to this issue? I'm not sure why this isn't working.
The code to change the version of Zookeeper is just the part of buildImage that sets the build-arg variables. The rewriteDockerfile routine only changes the Docker namespace and Weathervane version number in the Dockerfiles for each service.
Attached! I retried on a clean box and see the same behavior.
I just figured out what is happening.
There is a typo in the buildDockerImages.pl script. The line:
if ($imageName eq "zookeper") {
should read:
if ($imageName eq "zookeeper") {
Note the missing e
in zookeeper.
I will fix this and put out a new release, but for now the quick workaround is to edit the file and add the missing e
.
This got past my testing because the default version in the Dockerfile was available at the time of the release, and so everything worked despite the typo.
Please let me know if this fixes the problem.
This will be fixed in the upcoming 2.0 release