Skip to content

Commit 4e79d83

Browse files
committed
Split system and script dockerfiles
1 parent 60151bb commit 4e79d83

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ A custom Build of OpenJDK 9 Sources for EV3, a Lego Mindstorms Brick using ARM S
66
1. Install [Docker](https://docs.docker.com/engine/installation/) for your operating system.
77
2. Build the jdk9 cross-compilation environment:
88
```sh
9-
sudo docker build -t jdk9cross build
9+
sudo docker build -t ev3dev-lang-java:jdk9-system -f Dockerfile.system build
10+
sudo docker build -t ev3dev-lang-java:jdk9-build -f Dockerfile.scripts build
1011
```
1112
3. Run the newly prepared container. We recommend mounting a host directory to the the `/build` directory in the container. At least 2 GB of free space will be needed.
1213
```
13-
sudo docker run -it -v <path on host, where the sources should be stored>:/build jdk9cross
14+
sudo docker run -it -v <path on host, where the sources should be stored>:/build ev3dev-lang-java:jdk9-build
1415
```
1516
4. Let's fetch the OpenJDK sources:
1617
```

build/Dockerfile.scripts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ev3dev-lang-java:jdk9-system
2+
3+
# copy build patches & scripts
4+
RUN mkdir /opt/jdkcross
5+
COPY *.patch *.sh /opt/jdkcross/
6+
RUN chmod +x /opt/jdkcross/*.sh
7+
8+
# this directory should be mounted
9+
VOLUME /build
10+
11+
USER compiler
12+
WORKDIR /opt/jdkcross
13+
CMD ["/bin/bash"] ["--login"]

build/Dockerfile renamed to build/Dockerfile.system

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,11 @@ RUN dpkg --add-architecture armel && \
4848
mercurial \
4949
zlib1g-dev
5050

51-
52-
# copy build patches & scripts
53-
RUN mkdir /opt/jdkcross
54-
COPY *.patch *.sh /opt/jdkcross/
55-
RUN chmod +x /opt/jdkcross/*.sh
56-
57-
# download JDK >=8
51+
# download JDK 9
5852
RUN curl -SL http://download.java.net/java/GA/jdk9/9.0.1/binaries/openjdk-9.0.1_linux-x64_bin.tar.gz | tar -xzC /opt/jdkcross
5953

60-
# this directory should be mounted
61-
VOLUME /build
62-
63-
# prepare nonroot user
54+
# prepare a nonroot user
6455
COPY compiler.sudoers /etc/sudoers.d/compiler
6556
RUN chmod 0440 /etc/sudoers.d/compiler && \
6657
adduser --disabled-password --gecos \"\" compiler && \
6758
usermod -a -G sudo compiler
68-
USER compiler
69-
WORKDIR /opt/jdkcross
70-
CMD ["/bin/bash"] ["--login"]

0 commit comments

Comments
 (0)