Learn

Learn about latest technology

Build

Unleash your talent and coding!

Share

Let more people use it to improve!
 

Making available an Unscanned Cassandra image from the official docker file

miércoles, 21 de noviembre de 2018

I want to make here a constructive criticism, make thing easy please to all companies that work in open source environment. We make to many thing for free but that not mean that it shouldn't be almost(not completely) perfect.

The problem to solve in this post is that when I want to create a Cassandra ver 3.7 Image from the Oficial Docker file, the process fail and when I take a look in internet too many people are facing the same problem. So the docker file is wrong in that version an in others.

I have tested Cassandra Docker Hub repository and its true that we can build our images from his sources docker files BUT quite well just only few of them (see image below).

If you want to pull Cassandra image and spin up containers it can be done with almost all Cassandra versions. You can take a look, there are Scanned and Unscanned images and if you try to build images from source and the tag that you want to build image from is an Unscanned images perhaps you will face too many troubles.

I gonna try with Cassandra 3.7 and the first thing that I am going to do is follow the instructions described in the Cassandra github repository about its docker file template and surprisingly we get an Error or even using the dockerfile Cassandra version  3.7 we face the same error, see image below.


So in a best case when I construct the image changing the Debian's suite  I have to refactor it because the image can be can be built it BUT  the cqlsh tool cannot be accessed, see image below.


You can dive into github post  that explain how other Unscanned  Cassandra versions are facing the same problem when you try to create image from docker file.

Any way is frustrating after to many hours trying, so finally we refactored the image for solve the problems with openjdk-8-jre-headless adding to the official image the following snapshot of code:

RUN { \
  echo 'Package: openjdk-* ca-certificates-java'; \
  echo 'Pin: release n=*-backports'; \
  echo 'Pin-Priority: 990'; \
 } > /etc/apt/preferences.d/java-backports

You can find the solution for several version of cassandra docker files images in case that you want to build images from source in Cassandra version (3.9 - 3.10) that's the code that I have indicated previously.

You can find all the source code of Cassandra's image ver 3.7 in my github repository. We have tested it but if you have any problems please send us a feedback.

For many reason we should need to build an Official image from its sources for example is we need to add a layer to the image for Liveness and Readiness Probes in case of we want orchestrate our container with Kubernetes, it is not an obligation it is just a good practice. You can face the same situation in Docker when you are defining your Docker Compose yaml file. In next posts I am going to explain how deal with it.





1 comentarios:

ldipotet dijo...
Este comentario ha sido eliminado por el autor.

Publicar un comentario