Remote Code Execution Docker images for 40+ programming languages built with Nix.
Note
Prebuilt images are available on Docker Hub
This repository contains Nix definitions to build Docker images for executing code in various programming languages. Each image:
- Is built reproducibly using Nix
- Contains a language-specific environment with common libraries
- Includes the rce-runner to handle code execution
- Returns execution results in a standardized JSON format
Run a simple JavaScript program:
echo '{
"language": "javascript",
"files": [{
"name": "main.js",
"content": "console.log(\"Hello World!\");"
}]
}' | docker run --rm -i --read-only --tmpfs /tmp:rw,noexec,nosuid,size=65536k \
--tmpfs /home/rce:rw,exec,nosuid,uid=1000,gid=1000,size=131072k \
-u rce -w /home/rce toolkithub/javascript:latest
Output:
{ "stdout": "Hello World!\n", "stderr": "", "error": "" }
- Nix with flakes enabled
- Docker
- To build a specific language image:
# For example, to build the Python image
nix-build src/languages/python.nix
- Load the image into Docker:
docker load < result
This project uses a Nix flake for development:
# Enter development shell
nix develop
See License