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

0 vote
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.  

0 vote

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

741 views 21 12
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