forked from jutge-org/jutge-server-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjutge-run
executable file
·38 lines (28 loc) · 914 Bytes
/
jutge-run
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
#!/usr/bin/env bash
function usage() {
fmt <<EOF
Usage: jutge-run <image-name> [args...]
Execute commands in a container using one of the Jutge images.
The <image-name> will be prefixed with "jutgeorg/" (so you don't need
to include it). Available images are stored at Docker Hub
(https://hub.docker.com/u/jutgeorg).
Example <image-name>s: "gcc", "python", "java", "haskell" and "extra".
This is the production version, so the current directory is NOT
mounted and all communication is expected to be through pipes.
The command executed inside the container is "jutge-submit", so
any arguments will be passed to it.
EOF
}
if [ "$#" -lt 1 ] || [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
usage
exit
fi
image="$1"
shift # consume 1st argument so that $@ contains the rest
# Run it
docker run --rm -i \
--network none \
--memory=1g \
--cpus=1 \
jutgeorg/$image \
jutge-submit $@