Help Creating Go Sandbox To Execute Untrusted Golang Code


I am interested in a Go sandbox to execute arbitrary, untrusted Go code delivered via curl.

I believe the most well-known sandbox like this is

I found the github repo where this code lives ( and I am trying to run the example they provide in the repo.

The README from the Github seems to suggest I can execute arbitrary code via a Docker image + curl.

Here is the example from the README below.

docker build -t golang/playground .
docker run -d --name=play --rm -p 8080:8080 golang/playground
# run some Go code
cat /path/to/hello_world.go | go run client.go | curl -s --upload-file - localhost:8080/compile

While this seems straightforward, it isn’t working.

Issue seems to be a “SANDBOX_BACKEND_URL” environment variable.


#Golang Error
cmdFunc error: POST "http://sandbox_dev.sandnet/run": Post "http://sandbox_dev.sandnet/run": dial     tcp: lookup sandbox_dev.sandnet on no such host

#http/mux Error
2020/10/17 20:39:26 http: panic serving
no SANDBOX_BACKEND_URL environment and no default defined for project ""

Can anyone can help me understand the error and help me execute the code from the example?

What I’ve Tried So Far:

There is a Makefile in the Github repo that has some steps for running the Dockerized environment.

The relative contents of the Makefile are:

    docker network create sandnet || true
    docker kill play_dev || true
    docker run --name=play_dev --rm --network=sandnet -ti -p golang/
    playground --backend-url="http://sandbox_dev.sandnet/run"

When I create the Docker network and run the container with the --backend-url set it runs into the same problem.