$ apt-get update
$ apt-get install docker.io -y
$ systemctl enable docker
- Setup
$ mkdir -p /etc/pindo/ab8cb4fe-cd08-4a55-8444-2cdcd23d3492
$ echo "python /code/run.py" > /etc/pindo/ab8cb4fe-cd08-4a55-8444-2cdcd23d3492/exec.sh
$ chmod +x /etc/pindo/ab8cb4fe-cd08-4a55-8444-2cdcd23d3492/exec.sh
- Create the Code Snippet
/etc/pindo/ab8cb4fe-cd08-4a55-8444-2cdcd23d3492/run.py
if __name__ == '__main__':
print("Hello World")
- Create
runner.py
file to create container and run the file.
import docker
if __name__ == '__main__':
client = docker.from_env()
print(client.containers.run(
"python:3.8",
"bash /code/exec.sh",
volumes={'/etc/pindo/ab8cb4fe-cd08-4a55-8444-2cdcd23d3492': {'bind': '/code', 'mode': 'rw'}}
))
- Setup
$ mkdir -p /etc/pindo/286aabd5-9271-4985-a04e-6abedaab09dd
$ echo "ruby /code/run.rb" > /etc/pindo/286aabd5-9271-4985-a04e-6abedaab09dd/exec.sh
$ chmod +x /etc/pindo/286aabd5-9271-4985-a04e-6abedaab09dd/exec.sh
- Create the Code Snippet
/etc/pindo/286aabd5-9271-4985-a04e-6abedaab09dd/run.rb
- Create
runner.py
file to create container and run the file.
import docker
if __name__ == '__main__':
client = docker.from_env()
print(client.containers.run(
"ruby:3.0",
"bash /code/exec.sh",
volumes={'/etc/pindo/286aabd5-9271-4985-a04e-6abedaab09dd': {'bind': '/code', 'mode': 'rw'}}
))
- Setup
$ mkdir -p /etc/pindo/85de04dd-2059-4bd8-aa2b-7d40998183e3
$ echo "php /code/run.php" > /etc/pindo/85de04dd-2059-4bd8-aa2b-7d40998183e3/exec.sh
$ chmod +x /etc/pindo/85de04dd-2059-4bd8-aa2b-7d40998183e3/exec.sh
- Create the Code Snippet
/etc/pindo/85de04dd-2059-4bd8-aa2b-7d40998183e3/run.php
<?php
echo "Hello World\n";
- Create
runner.py
file to create container and run the file.
import docker
if __name__ == '__main__':
client = docker.from_env()
print(client.containers.run(
"php:7.4",
"bash /code/exec.sh",
volumes={'/etc/pindo/85de04dd-2059-4bd8-aa2b-7d40998183e3': {'bind': '/code', 'mode': 'rw'}}
))
- Setup
$ mkdir -p /etc/pindo/2533e7c6-9fd5-4b5c-9632-1da6e919ae4a
$ echo "cd /code
go build run.go
./run" > /etc/pindo/2533e7c6-9fd5-4b5c-9632-1da6e919ae4a/exec.sh
$ chmod +x /etc/pindo/2533e7c6-9fd5-4b5c-9632-1da6e919ae4a/exec.sh
- Create the Code Snippet
/etc/pindo/2533e7c6-9fd5-4b5c-9632-1da6e919ae4a/run.go
package main
import "fmt"
func main() {
fmt.Println("Hello World")
}
- Create
runner.py
file to create container and run the file.
import docker
if __name__ == '__main__':
client = docker.from_env()
print(client.containers.run(
"golang:1.17",
"bash /code/exec.sh",
volumes={'/etc/pindo/2533e7c6-9fd5-4b5c-9632-1da6e919ae4a': {'bind': '/code', 'mode': 'rw'}}
))
$ mkdir -p /etc/pindo/4b982684-e108-4e7a-a95c-f41d269a7026
$ echo "cd /code
rustc run.rs
./run" > /etc/pindo/4b982684-e108-4e7a-a95c-f41d269a7026/exec.sh
$ chmod +x /etc/pindo/4b982684-e108-4e7a-a95c-f41d269a7026/exec.sh
- Create the Code Snippet
/etc/pindo/4b982684-e108-4e7a-a95c-f41d269a7026/run.rs
fn main() {
println!("Hello, world!");
}
- Create
runner.py
file to create container and run the file.
import docker
if __name__ == '__main__':
client = docker.from_env()
print(client.containers.run(
"rust:1.57.0",
"bash /code/exec.sh",
volumes={'/etc/pindo/4b982684-e108-4e7a-a95c-f41d269a7026': {'bind': '/code', 'mode': 'rw'}}
))
$ mkdir -p /etc/pindo/447c1b5b-8332-435a-a815-9c2a5acbec26
$ echo "cd /code
javac Run.java
java Run" > /etc/pindo/447c1b5b-8332-435a-a815-9c2a5acbec26/exec.sh
$ chmod +x /etc/pindo/447c1b5b-8332-435a-a815-9c2a5acbec26/exec.sh
- Create the Code Snippet
/etc/pindo/447c1b5b-8332-435a-a815-9c2a5acbec26/Run.java
public class Run {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
- Create
runner.py
file to create container and run the file.
import docker
if __name__ == '__main__':
client = docker.from_env()
print(client.containers.run(
"openjdk:11",
"bash /code/exec.sh",
volumes={'/etc/pindo/447c1b5b-8332-435a-a815-9c2a5acbec26': {'bind': '/code', 'mode': 'rw'}}
))