Skip to content

Commit

Permalink
[LOG4J2-1950] Fix docker build with jdk9 requirements. Closes apache#84.
Browse files Browse the repository at this point in the history
  • Loading branch information
phymbert authored and garydgregory committed Jun 26, 2017
1 parent d3a8f09 commit 3f45368
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM openjdk:7-alpine
# FROM openjdk:7-alpine
# Reverted to debian yet alpine does not include jdk9
FROM openjdk:7-jdk

# Require while jdk9 is unstable on debian
RUN echo 'deb http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list

RUN set -ex \
&& mkdir /src \
&& apk update \
&& apk add curl \
&& mkdir /opt \
&& apt-get update \
&& apt-get install -y \
curl \
openjdk-9-jdk-headless \
&& ln -svT "/usr/lib/jvm/java-9-openjdk-$(dpkg --print-architecture)" /docker-java-9-home \
&& cd /opt \
&& curl -fsSL http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz -o maven.tar.gz \
&& curl -fsSL http://www-us.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz -o maven.tar.gz \
&& tar -xzf maven.tar.gz \
&& rm -f maven.tar.gz

COPY . /src

RUN set -ex \
&& cd /src \
&& /opt/apache-maven-3.3.9/bin/mvn verify
&& /opt/apache-maven-3.5.0/bin/mvn verify --global-toolchains toolchains-docker.xml
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
- "remove" - Removed
-->
<release version="2.9.0" date="2017-MM-DD" description="GA Release 2.9.0">
<action issue="LOG4J2-1950" dev="ggregory" type="update" due-to="Pierrick HYMBERT">
Fix docker build with jdk9 requirements (#84).
</action>
<action issue="LOG4J2-1801" dev="rpopma" type="update">
Add more detail to WARN "Ignoring log event" messages printed to the console after log4j was shut down.
</action>
Expand Down
42 changes: 42 additions & 0 deletions toolchains-docker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache license, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the license for the specific language governing permissions and
~ limitations under the license.
-->
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/docker-java-home</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>9</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/docker-java-9-home</jdkHome>
</configuration>
</toolchain>

<!-- other toolchains -->
</toolchains>

0 comments on commit 3f45368

Please sign in to comment.