-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#Ubuntu -> jdk8-bootstrap -> jdk9-source
#Version 0.3 20150217
FROM dockerfile/java:oracle-java8
MAINTAINER Daniel Winsor <[email protected]>
RUN apt-get update \
&& apt-get install -y \
git-core \
libasound2-dev \
libcups2-dev \
libfreetype6-dev \
libX11-dev \
libxext-dev \
libxrender-dev \
libxtst-dev \
libxt-dev \
mercurial \
zip
RUN groupadd -r openjdk \
&& useradd -r -g openjdk openjdk
#from https://java.net/projects/adoptopenjdk/pages/GetSource
ENV HOME /home/openjdk
ENV SOURCE_CODE $HOME/src/
RUN mkdir -p $SOURCE_CODE
#I don't know why COPY and ADD are not working, but I tried everything
RUN cat /root/.bashrc > $HOME/.bashrc
RUN chown -R openjdk:openjdk $HOME
WORKDIR $SOURCE_CODE
#USER openjdk
#If I switch user, /dev/stdout is still root
#Thus running get_source.sh below fails.
#One way or another you have to get the source
#I'm choosing to do it now, even though it makes the image larger,
#because then you start with something.
#You may want to `bash get_source.sh` again
RUN hg clone http://hg.openjdk.java.net/jdk9/dev jdk9 \
&& cd jdk9/ \
&& bash get_source.sh
RUN chown -R openjdk:openjdk $SOURCE_CODE