Skip to content

Commit ea65085

Browse files
committed
Add install instruction when using the glot/docker-run image
1 parent 0d6d6f2 commit ea65085

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

docs/install/docker-ubuntu-20.10.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Installation instructions for ubuntu 20.10
2+
3+
#### Install and configure docker
4+
5+
```bash
6+
apt install docker.io
7+
8+
# Disable docker networking (optional)
9+
echo '{
10+
"ip-forward": false,
11+
"iptables": false,
12+
"ipv6": false,
13+
"ip-masq": false
14+
}' > /etc/docker/daemon.json
15+
16+
# Restart docker daemon
17+
systemctl restart docker.service
18+
```
19+
20+
#### Pull the docker-run image
21+
22+
```bash
23+
docker pull glot/docker-run:latest
24+
```
25+
26+
27+
#### Pull images for the languages you want
28+
29+
```bash
30+
docker pull glot/python:latest
31+
docker pull glot/rust:latest
32+
# ...
33+
```
34+
35+
#### Start the docker-run container
36+
37+
```bash
38+
docker run --detach --restart=always --publish 8088:8088 --volume /var/run/docker.sock:/var/run/docker.sock --env "API_ACCESS_TOKEN=my-token" glot/docker-run:latest
39+
```
40+
41+
#### Check that everything is working
42+
43+
```bash
44+
# Print docker-run version
45+
curl http://localhost:8088
46+
47+
# Print docker version, etc
48+
curl --header 'X-Access-Token: my-token' http://localhost:8088/version
49+
50+
# Run python code
51+
curl --request POST --header 'X-Access-Token: my-token' --header 'Content-type: application/json' --data '{"image": "glot/python:latest", "payload": {"language": "python", "files": [{"name": "main.py", "content": "print(42)"}]}}' http://localhost:8088/run
52+
```

0 commit comments

Comments
 (0)