Skip to content

Commit 73a164b

Browse files
Initial commit
0 parents  commit 73a164b

9 files changed

Lines changed: 117 additions & 0 deletions

File tree

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*/.git
2+
*/.travis.yml
3+
*/README.md
4+
image-common/test/*
5+
image-common/test
6+
test
7+
test/*

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
[submodule "image-common"]
3+
path = image-common
4+
url = https://github.com/docker-exec/image-common.git

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM dexec/base-jdk
2+
MAINTAINER andystanton
3+
ADD image-common /tmp/dexec/image-common
4+
VOLUME /tmp/dexec/build
5+
ENTRYPOINT ["/tmp/dexec/image-common/dexec-runtime.sh", "javac", "java", ".class"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Andy Stanton
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Docker Exec Image: Java
2+
3+
A Dockerfile describing an container capable of executing Java source files.
4+
5+
# Build
6+
7+
```sh
8+
git clone https://github.com/docker-exec/java.git
9+
docker build -t dexec/java .
10+
```
11+
12+
# Usage
13+
14+
In a directory containing a script e.g. foo.java, run:
15+
16+
```sh
17+
docker run -t --rm \
18+
-v $(pwd -P)/foo.java:/tmp/dexec/build/foo.java \
19+
dexec/java foo.java
20+
```
21+
22+
## Passing arguments to the script
23+
24+
Arguments can be passed to the script using any of the following forms:
25+
26+
```
27+
-a argument
28+
--arg argument
29+
--arg=argument
30+
```
31+
32+
Each argument passed must be prefixed in this way, e.g.
33+
34+
```sh
35+
docker run -t --rm \
36+
-v $(pwd -P)/foo.java:/tmp/dexec/build/foo.java \
37+
dexec/java foo.java \
38+
--arg='hello world' \
39+
--arg=foo \
40+
--arg=bar
41+
```
42+
43+
## Passing arguments to the compiler
44+
45+
Arguments can be passed to the compiler using any of the following forms:
46+
47+
```
48+
-b argument
49+
--build-arg argument
50+
--build-arg=argument
51+
```
52+
53+
Each argument passed must be prefixed in this way, e.g.
54+
55+
```sh
56+
docker run -t --rm \
57+
-v $(pwd -P)/foo.java:/tmp/dexec/build/foo.java \
58+
dexec/java foo.java \
59+
--build-arg=-some-compiler-option \
60+
--build-arg=some-compiler-option-value
61+
```

image-common

Submodule image-common added at 3ef9d31

test/EchoChamber.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public class EchoChamber {
2+
public static void main(String[] args) {
3+
for (String arg : args) {
4+
System.out.println(arg);
5+
}
6+
}
7+
}

test/HelloWorld.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class HelloWorld {
2+
public static void main(String[] args) {
3+
System.out.println("hello world");
4+
}
5+
}

test/Shebang.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env dexec
2+
public class Shebang {
3+
public static void main(String[] args) {
4+
System.out.println("hello world");
5+
}
6+
}

0 commit comments

Comments
 (0)