How to update the official Confluence Docker image to use the Oracle JDK?
Asked by StefanN:

According to the "Support" paragraph in the official Confluence Docker image description, the actual image does not bundle the Oracle JDK and users are advised to build their own image:

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

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

I tried it but it is not clear at all how to proceed. With the official Docker image I have configured Confluence to use PostgreSQL. When I look at the linked Dockerfile, I see only the MySQL adapter and a completely different structue from the original Confluence Docker image:

<https://bitbucket.org/atlassian/docker-atlassian-confluence-server/src>

And besides, when trying to build this custom confluence image, it aborts with an error message:

```
docker build -t my-confluence .Sending build context to Docker daemon 6.144 kBStep 1 : FROM oracle/serverjre:8 ---> d2f9b6a0c70bStep 2 : MAINTAINER Atlassian Confluence ---> Running in 41102a35ad84 ---> b32fb57a1193Removing intermediate container 41102a35ad84Step 3 : ENV CONFLUENCE_HOME /var/atlassian/application-data/confluence ---> Running in 0f6b1ca8937b ---> ead9753e012fRemoving intermediate container 0f6b1ca8937bStep 4 : ENV CONFLUENCE_INSTALL /opt/atlassian/confluence ---> Running in 8e0b5bcac13b ---> 8c8a82e263fcRemoving intermediate container 8e0b5bcac13bStep 5 : ENV CONF_VERSION 6.1.1 ---> Running in cd09661eca36 ---> 1b26d4018304Removing intermediate container cd09661eca36Step 6 : LABEL Description "This image is used to start Atlassian Confluence" Vendor "Atlassian" Version "${CONF_VERSION}" ---> Running in 08f0f1e1f977 ---> 74c48448e255Removing intermediate container 08f0f1e1f977Step 7 : ENV CONFLUENCE_DOWNLOAD_URL http://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONF_VERSION}.tar.gz ---> Running in ae0d4335e1a2 ---> 72d87e58a1a4Removing intermediate container ae0d4335e1a2Step 8 : ENV MYSQL_VERSION 5.1.38 ---> Running in 534d9ea0105d ---> ac0dfe2109caRemoving intermediate container 534d9ea0105dStep 9 : ENV MYSQL_DRIVER_DOWNLOAD_URL http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MYSQL_VERSION}.tar.gz ---> Running in ef776d9e7ee0 ---> 3571b965666aRemoving intermediate container ef776d9e7ee0Step 10 : ENV RUN_USER daemon ---> Running in e1f460e1c8cc ---> 0976d988555bRemoving intermediate container e1f460e1c8ccStep 11 : ENV RUN_GROUP daemon ---> Running in fdf97c9fe5e3 ---> cdd2e01624e6Removing intermediate container fdf97c9fe5e3Step 12 : RUN set -x     && apt-get update --quiet     && apt-get install --quiet --yes --no-install-recommends libtcnative-1 xmlstarlet     && apt-get clean     && mkdir -p                           "${CONFLUENCE_HOME}"     && chmod -R 700                       "${CONFLUENCE_HOME}"     && chown ${RUN_USER}:${RUN_GROUP}     "${CONFLUENCE_HOME}"     && mkdir -p                           "${CONFLUENCE_INSTALL}/conf"     && curl -Ls                           "${CONFLUENCE_DOWNLOAD_URL}" | tar -xz --directory "${CONFLUENCE_INSTALL}" --strip-components=1 --no-same-owner     && curl -Ls                           "${MYSQL_DRIVER_DOWNLOAD_URL}" | tar -xz --directory "${CONFLUENCE_INSTALL}/confluence/WEB-INF/lib" --strip-components=1 --no-same-owner "mysql-connector-java-${MYSQL_VERSION}/mysql-connector-java-${MYSQL_VERSION}-bin.jar"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/conf"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/temp"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/logs"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/work"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/conf"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/temp"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/logs"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/work"     && echo -e                            "\nconfluence.home=${CONFLUENCE_HOME}" >> "${CONFLUENCE_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties"     && xmlstarlet                         ed --inplace         --delete                          "Server/@debug"         --delete                          "Server/Service/Connector/@debug"         --delete                          "Server/Service/Connector/@useURIValidationHack"         --delete                          "Server/Service/Connector/@minProcessors"         --delete                          "Server/Service/Connector/@maxProcessors"         --delete                          "Server/Service/Engine/@debug"         --delete                          "Server/Service/Engine/Host/@debug"         --delete                          "Server/Service/Engine/Host/Context/@debug"                                           "${CONFLUENCE_INSTALL}/conf/server.xml"     && touch -d "@0"                      "${CONFLUENCE_INSTALL}/conf/server.xml" ---> Running in 5001507b06c9+ apt-get update --quiet/bin/sh: apt-get: command not foundThe command '/bin/sh -c set -x     && apt-get update --quiet     && apt-get install --quiet --yes --no-install-recommends libtcnative-1 xmlstarlet     && apt-get clean     && mkdir -p                           "${CONFLUENCE_HOME}"     && chmod -R 700                       "${CONFLUENCE_HOME}"     && chown ${RUN_USER}:${RUN_GROUP}     "${CONFLUENCE_HOME}"     && mkdir -p                           "${CONFLUENCE_INSTALL}/conf"     && curl -Ls                           "${CONFLUENCE_DOWNLOAD_URL}" | tar -xz --directory "${CONFLUENCE_INSTALL}" --strip-components=1 --no-same-owner     && curl -Ls                           "${MYSQL_DRIVER_DOWNLOAD_URL}" | tar -xz --directory "${CONFLUENCE_INSTALL}/confluence/WEB-INF/lib" --strip-components=1 --no-same-owner "mysql-connector-java-${MYSQL_VERSION}/mysql-connector-java-${MYSQL_VERSION}-bin.jar"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/conf"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/temp"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/logs"     && chmod -R 700                       "${CONFLUENCE_INSTALL}/work"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/conf"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/temp"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/logs"     && chown -R ${RUN_USER}:${RUN_GROUP}  "${CONFLUENCE_INSTALL}/work"     && echo -e                            "\nconfluence.home=${CONFLUENCE_HOME}" >> "${CONFLUENCE_INSTALL}/confluence/WEB-INF/classes/confluence-init.properties"     && xmlstarlet                         ed --inplace         --delete                          "Server/@debug"         --delete                          "Server/Service/Connector/@debug"         --delete                          "Server/Service/Connector/@useURIValidationHack"         --delete                          "Server/Service/Connector/@minProcessors"         --delete                          "Server/Service/Connector/@maxProcessors"         --delete                          "Server/Service/Engine/@debug"         --delete                          "Server/Service/Engine/Host/@debug"         --delete                          "Server/Service/Engine/Host/Context/@debug"                                           "${CONFLUENCE_INSTALL}/conf/server.xml"     && touch -d "@0"                      "${CONFLUENCE_INSTALL}/conf/server.xml"' returned a non-zero code: 127
```

I get the feeling that it is hopelessly outdated or the sync between the Oracle Docker image is lost.

So my question stands - how to update the official Confluence Docker image to use the Oracle JDK?

Thanks.


Answers:
author: Curtis
body: Were you able to get this working?


Tags: docker

java

jdk

oracle