Skip to content

Commit 0c3f1ed

Browse files
committed
Add slim variants
1 parent 5fb0ba0 commit 0c3f1ed

22 files changed

+799
-66
lines changed

6-jdk/Dockerfile

+15-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
FROM buildpack-deps:wheezy-scm
88

9-
# A few problems with compiling Java from source:
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
1011
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
1113
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
12-
# really hairy.
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-6
1318

1419
RUN apt-get update && apt-get install -y --no-install-recommends \
1520
bzip2 \
@@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1
3944

4045
RUN set -ex; \
4146
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
4252
apt-get update; \
4353
apt-get install -y \
4454
openjdk-6-jdk="$JAVA_DEBIAN_VERSION" \
@@ -54,4 +64,6 @@ RUN set -ex; \
5464
update-alternatives --query java | grep -q 'Status: manual'
5565

5666
# If you're reading this and have any feedback on how this image could be
57-
# improved, please open an issue or a pull request so we can discuss it!
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

6-jdk/slim/Dockerfile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM debian:wheezy-slim
8+
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
11+
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
13+
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-6
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
bzip2 \
21+
unzip \
22+
xz-utils \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Default to UTF-8 file.encoding
26+
ENV LANG C.UTF-8
27+
28+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
29+
# based on whether the JDK or only the JRE is installed
30+
RUN { \
31+
echo '#!/bin/sh'; \
32+
echo 'set -e'; \
33+
echo; \
34+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35+
} > /usr/local/bin/docker-java-home \
36+
&& chmod +x /usr/local/bin/docker-java-home
37+
38+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
39+
RUN ln -svT "/usr/lib/jvm/java-6-openjdk-$(dpkg --print-architecture)" /docker-java-home
40+
ENV JAVA_HOME /docker-java-home
41+
42+
ENV JAVA_VERSION 6b38
43+
ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1
44+
45+
RUN set -ex; \
46+
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
52+
apt-get update; \
53+
apt-get install -y \
54+
openjdk-6-jdk="$JAVA_DEBIAN_VERSION" \
55+
; \
56+
rm -rf /var/lib/apt/lists/*; \
57+
\
58+
# verify that "docker-java-home" returns what we expect
59+
[ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \
60+
\
61+
# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java
62+
update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \
63+
# ... and verify that it actually worked for one of the alternatives we care about
64+
update-alternatives --query java | grep -q 'Status: manual'
65+
66+
# If you're reading this and have any feedback on how this image could be
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

6-jre/Dockerfile

+15-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
FROM buildpack-deps:wheezy-curl
88

9-
# A few problems with compiling Java from source:
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
1011
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
1113
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
12-
# really hairy.
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-6
1318

1419
RUN apt-get update && apt-get install -y --no-install-recommends \
1520
bzip2 \
@@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1
3944

4045
RUN set -ex; \
4146
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
4252
apt-get update; \
4353
apt-get install -y \
4454
openjdk-6-jre-headless="$JAVA_DEBIAN_VERSION" \
@@ -54,4 +64,6 @@ RUN set -ex; \
5464
update-alternatives --query java | grep -q 'Status: manual'
5565

5666
# If you're reading this and have any feedback on how this image could be
57-
# improved, please open an issue or a pull request so we can discuss it!
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

6-jre/slim/Dockerfile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM debian:wheezy-slim
8+
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
11+
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
13+
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-6
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
bzip2 \
21+
unzip \
22+
xz-utils \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Default to UTF-8 file.encoding
26+
ENV LANG C.UTF-8
27+
28+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
29+
# based on whether the JDK or only the JRE is installed
30+
RUN { \
31+
echo '#!/bin/sh'; \
32+
echo 'set -e'; \
33+
echo; \
34+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35+
} > /usr/local/bin/docker-java-home \
36+
&& chmod +x /usr/local/bin/docker-java-home
37+
38+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
39+
RUN ln -svT "/usr/lib/jvm/java-6-openjdk-$(dpkg --print-architecture)" /docker-java-home
40+
ENV JAVA_HOME /docker-java-home/jre
41+
42+
ENV JAVA_VERSION 6b38
43+
ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1
44+
45+
RUN set -ex; \
46+
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
52+
apt-get update; \
53+
apt-get install -y \
54+
openjdk-6-jre-headless="$JAVA_DEBIAN_VERSION" \
55+
; \
56+
rm -rf /var/lib/apt/lists/*; \
57+
\
58+
# verify that "docker-java-home" returns what we expect
59+
[ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \
60+
\
61+
# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java
62+
update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \
63+
# ... and verify that it actually worked for one of the alternatives we care about
64+
update-alternatives --query java | grep -q 'Status: manual'
65+
66+
# If you're reading this and have any feedback on how this image could be
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

7-jdk/Dockerfile

+15-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
FROM buildpack-deps:jessie-scm
88

9-
# A few problems with compiling Java from source:
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
1011
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
1113
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
12-
# really hairy.
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-7
1318

1419
RUN apt-get update && apt-get install -y --no-install-recommends \
1520
bzip2 \
@@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 7u131-2.6.9-2~deb8u1
3944

4045
RUN set -ex; \
4146
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
4252
apt-get update; \
4353
apt-get install -y \
4454
openjdk-7-jdk="$JAVA_DEBIAN_VERSION" \
@@ -54,4 +64,6 @@ RUN set -ex; \
5464
update-alternatives --query java | grep -q 'Status: manual'
5565

5666
# If you're reading this and have any feedback on how this image could be
57-
# improved, please open an issue or a pull request so we can discuss it!
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

7-jdk/alpine/Dockerfile

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
FROM alpine:3.6
88

9-
# A few problems with compiling Java from source:
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
1011
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
1113
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
12-
# really hairy.
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-7
1318

1419
# Default to UTF-8 file.encoding
1520
ENV LANG C.UTF-8
@@ -33,3 +38,8 @@ RUN set -x \
3338
&& apk add --no-cache \
3439
openjdk7="$JAVA_ALPINE_VERSION" \
3540
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
41+
42+
# If you're reading this and have any feedback on how this image could be
43+
# improved, please open an issue or a pull request so we can discuss it!
44+
#
45+
# https://github.com/docker-library/openjdk/issues

7-jdk/slim/Dockerfile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM debian:jessie-slim
8+
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
11+
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
13+
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-7
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
bzip2 \
21+
unzip \
22+
xz-utils \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Default to UTF-8 file.encoding
26+
ENV LANG C.UTF-8
27+
28+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
29+
# based on whether the JDK or only the JRE is installed
30+
RUN { \
31+
echo '#!/bin/sh'; \
32+
echo 'set -e'; \
33+
echo; \
34+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35+
} > /usr/local/bin/docker-java-home \
36+
&& chmod +x /usr/local/bin/docker-java-home
37+
38+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
39+
RUN ln -svT "/usr/lib/jvm/java-7-openjdk-$(dpkg --print-architecture)" /docker-java-home
40+
ENV JAVA_HOME /docker-java-home
41+
42+
ENV JAVA_VERSION 7u131
43+
ENV JAVA_DEBIAN_VERSION 7u131-2.6.9-2~deb8u1
44+
45+
RUN set -ex; \
46+
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
52+
apt-get update; \
53+
apt-get install -y \
54+
openjdk-7-jdk="$JAVA_DEBIAN_VERSION" \
55+
; \
56+
rm -rf /var/lib/apt/lists/*; \
57+
\
58+
# verify that "docker-java-home" returns what we expect
59+
[ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \
60+
\
61+
# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java
62+
update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \
63+
# ... and verify that it actually worked for one of the alternatives we care about
64+
update-alternatives --query java | grep -q 'Status: manual'
65+
66+
# If you're reading this and have any feedback on how this image could be
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

7-jre/Dockerfile

+15-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
FROM buildpack-deps:jessie-curl
88

9-
# A few problems with compiling Java from source:
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
1011
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
1113
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
12-
# really hairy.
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-7
1318

1419
RUN apt-get update && apt-get install -y --no-install-recommends \
1520
bzip2 \
@@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 7u131-2.6.9-2~deb8u1
3944

4045
RUN set -ex; \
4146
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
4252
apt-get update; \
4353
apt-get install -y \
4454
openjdk-7-jre-headless="$JAVA_DEBIAN_VERSION" \
@@ -54,4 +64,6 @@ RUN set -ex; \
5464
update-alternatives --query java | grep -q 'Status: manual'
5565

5666
# If you're reading this and have any feedback on how this image could be
57-
# improved, please open an issue or a pull request so we can discuss it!
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

0 commit comments

Comments
 (0)