-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add install instruction when using the glot/docker-run image
- Loading branch information
1 parent
0d6d6f2
commit ea65085
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Installation instructions for ubuntu 20.10 | ||
|
||
#### Install and configure docker | ||
|
||
```bash | ||
apt install docker.io | ||
|
||
# Disable docker networking (optional) | ||
echo '{ | ||
"ip-forward": false, | ||
"iptables": false, | ||
"ipv6": false, | ||
"ip-masq": false | ||
}' > /etc/docker/daemon.json | ||
|
||
# Restart docker daemon | ||
systemctl restart docker.service | ||
``` | ||
|
||
#### Pull the docker-run image | ||
|
||
```bash | ||
docker pull glot/docker-run:latest | ||
``` | ||
|
||
|
||
#### Pull images for the languages you want | ||
|
||
```bash | ||
docker pull glot/python:latest | ||
docker pull glot/rust:latest | ||
# ... | ||
``` | ||
|
||
#### Start the docker-run container | ||
|
||
```bash | ||
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 | ||
``` | ||
|
||
#### Check that everything is working | ||
|
||
```bash | ||
# Print docker-run version | ||
curl http://localhost:8088 | ||
|
||
# Print docker version, etc | ||
curl --header 'X-Access-Token: my-token' http://localhost:8088/version | ||
|
||
# Run python code | ||
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 | ||
``` |