Docker build fails building confluence

The confluence docker image page states that the product is not supported under openJDK and suggests building with oracleJDK.

https://hub.docker.com/r/atlassian/confluence-server/

When the advice on the following page is followed:

https://confluence.atlassian.com/confkb/update-the-confluence-docker-image-to-use-oracle-jdk-829062521.html

the line from the confluence docker image is changed from:

FROM openjdk:8-jdk-alpine

to:

FROM oracle/serverjre:9

This causes an error when building the confluence image with the new base image:

/bin/sh: apk: command not found

 This makes sense as apk is a package manager for alpine and I just removed it when changing the base image.

There is a clear conflict when following instructions to create a supported docker image. 

How can I create a supported docker image? 

2 answers

This widget could not be displayed.
Ann Worley Atlassian Team Jan 16, 2018

The way I understand the documentation, you download and install the Oracle JDK before the build and then you won't need a package manager to install it, you would use:

FROM oracle/JDK:8

Please note that JRE 9 is not a supported platform for Confluence 6.6.x: Supported Platforms

Thank you for pointing out that JRE 9 is not supported.

The apk package manager is not being used to download and install Oracle JDK. That process is done in a previous step. 

The second build process uses the apk package manager to do the following: 

RUN apk update -qq \
    && update-ca-certificates \
    && apk add ca-certificates wget curl openssh bash procps openssl perl ttf-dejavu tini libc6-compat \
    && rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/*

That is within the confluence docker file at:

https://bitbucket.org/atlassian/docker-atlassian-confluence-server/src/37d9ecc3ad569e0c49935e6ee296ddc46bc2c0fa/Dockerfile?at=base-6&fileviewer=file-view-default

Which is where the build process fails.  

This widget could not be displayed.

Hi Volkan, 

I found a few more suggestions online for users trying to build a Alpine based docker image. Perhaps they could help you?

  1. Try apk update and apk add, or
  2. RUN apk add --no-cache bash (keeps the image small) or
  3. Someone also mentioned to try using RUN /bin/sh instead of bash, or even RUN /bin/sh -c "apk add --no-cache bash"

Let us know if you have any success.

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

606 views 8 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you