Over a million developers have joined DZone.

Bleeding Edge on Docker

Infinispan Docker images are usually published with their release, but what do you do if you want to try out some brand new features which have just been merged? Read on to find out how to handle this.

· DevOps Zone

The DevOps zone is brought to you in partnership with Sonatype Nexus. The Nexus suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

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
cd infinispan

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
cd infinispan
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 Infinispan Download 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

#With this:
USER root
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
USER jboss

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. Openshift Online)

Happy building!

The DevOps zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today


Published at DZone with permission of Sebastian Laskawiec. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}