As you may have noticed, at Infinispan our Docker images are published together with (or very soon after) releases. But what if you want to try out some brand new features which have just been merged? In that case, you need to build an image by yourself.
Step #1 - Clone JBoss Docker Image Repository
At first, you will need to clone our Infinispan Docker images:
git clone https://github.com/jboss-dockerfiles/infinispan.git
Step #2 - Build or Download the Latest SNAPSHOT
There are two options here—you can build the distribution yourself or use SNAPSHOTs available on
JBoss Nexus repository
The first option requires checking out the Infinispan source code and performing a Maven build:
git clone https://github.com/infinispan/infinispan.git
mvn clean install -DskipTests
The second one is much simpler (Infinispan SNAPSHOTs are pushed into the repository after each successful build:
wget -L "https://repository.jboss.org/nexus/service/local/artifact/maven/redirect?r=snapshots&g=org.infinispan.server&a=infinispan-server-build&v=9.0.0-SNAPSHOT&e=zip"
Step #3 - Building Infinispan Docker Image
One of the steps for building Infinispan Docker image is to download the distribution from the
page. We need to slightly modify this step and use our manually downloaded packages.
Modify the Dockerfile as shown below:
#Replace this line:
RUN INFINISPAN_SHA=$(curl $DISTRIBUTION_URL.sha1); curl -o /tmp/server.zip $DISTRIBUTION_URL && sha1sum /tmp/server.zip | grep $INFINISPAN_SHA \
&& unzip -q /tmp/server.zip -d $HOME && mv $HOME/infinispan-server-* $HOME/infinispan-server && rm /tmp/server.zip
ADD infinispan-server-9.0.0-SNAPSHOT /opt/jboss/infinispan-server
#Since we are playing with development versions, we don't care about the permissions
RUN chmod -R 777 /opt/jboss/infinispan-server
RUN chmod +x /opt/jboss/infinispan-server/bin/*.sh
Now you are ready to invoke the Docker build:
docker build -t infinispan-server .
As you can see building a SNAPSHOT based docker image is very simple. From my own experience I can tell you that pushing it into Docker Hub is the fastest way to start playing with it in any PaaS environment (e.g.