Skip to content

Commit 0ab4aa8

Browse files
committed
Add shell script
1 parent 7cc52f7 commit 0ab4aa8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ The base image is Ubuntu, with Java, Maven, Kotlin and kscript installed with [S
1616

1717
`docker run -i serandel/kscript - < script.kts`
1818

19-
This will make kscript read the code from `stdin` while piping the file. Be aware that the `-i` flag is needed to have `stdout` redirected outside the container.
19+
This will make kscript read the code from `stdin` while piping the file. Be aware that the `-i` flag is needed to have `stdout` redirected outside the container. `--rm` is just to stop polluting Docker with stopped containers.
2020

2121
## Volume
2222

2323
It's highly advisable to create a volume for `/root/.kscript` so the JARs are cached between different invocations to containers.
2424

25-
`docker run -i -v kscript:/root/.kscript serandel/kscript 'println("Hello, world!")'`
25+
`docker run -i --rm -v kscript:/root/.kscript serandel/kscript 'println("Hello, world!")'`
26+
27+
There is a `kscript.sh` Bash shell script that invokes the container with these arguments for your convenience.

kscript.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker run -i --rm -v kscript:/root/.kscript serandel/kscript "$1" "$@"

0 commit comments

Comments
 (0)