-
-
Notifications
You must be signed in to change notification settings - Fork 48
Can't run Docker container #10
Comments
Seems like the |
Yeah, I just realized that. I'm not sure how to set it correctly though. I know its not an issue with your project but could you help me out? |
You can pass the environment variables to docker run \
-p 8090:8090 \
--detach \
--restart always \
--env API_ENVIRONMENT="production" \
--env API_HTTP_LISTEN_IP="0.0.0.0" \
--env API_HTTP_LISTEN_PORT="8090" \
--env DATA_PATH="/home/app/data/" \
--env LOG_PATH="/home/app/log/" \
--env BASE_URL="https://run.glot.io" \
--env ADMIN_TOKEN="secret" \
--env DOCKER_API_URL="http://10.0.0.127" \
--env DOCKER_RUN_TIMEOUT="15" \
--env MAX_OUTPUT_SIZE="100000" \
--volume /containers/glot-run/data:/home/app/data \
--volume /containers/glot-run/log:/home/app/log \
glotrun |
Thank you so much for the help! It seems to be working now. Thanks for open sourcing this great project |
@prasmussen sorry, 1 last question! I tried sending a curl POST request to it, but I get an invalid token error even though I have the header |
Note the admin token only works for the the /admin endpoints, to create a normal user you can use the following query:
|
@prasmussen Thanks, but I'm still not able to get it working. When I make a POST to This is the stack trace in the docker logs.
it seems to be some sort of problem in spawning the docker container to run the program? |
Yes, it seems like container_create process times out. Make sure that that the glotrun container is able to access the docker api. Try doing |
@bobacadodl did you register the language in glot-run? Did you download the python container in your docker daemon? Check #9 for some scripts to download and register all languages 😉 |
I got it working. I did have the languages registered. The problem was that I was using the incorrect docker API URL (I just copied the example one) |
Hi, the issue is probably on my part, but I'd really like to use this project and I can't seem to get it working. (I am new to both docker and erlang)
I've pulled the glot-code-runner images for python and java, and they seem to be working. If I run the container with
docker run -it glot/python
and paste{"language": "python", "files": [{"name": "main.py", "content": "print(42)"}]}
into stdin, I get the correct JSON response.However, I can't get the glot-run project working. I tried editing the Dockerfile, to add those environment variables in it by adding lines
ENV [variable name]=[value]
, for each of the environment variables. For exampleENV API_ENVIRONMENT=production
.I then tried to build it, with the command
docker build --tag=glotrun .
And also added the line
DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
to/etc/default/docker
However, when I tried running it with the command
docker run -it -p 8090:8090 glotrun
, it fails with the following stack trace:I don't really know what this means and would greatly appreciate the help. Please let me know if there's any other info I should provide
EDIT: Looking through the code, it seems to be because my container's environment variables aren't properly set, so its failing on the line
list_to_integer(os:getenv("API_HTTP_LISTEN_PORT")).
. but I added them to the Dockerfile.. so I'm not sure what's wrongThe text was updated successfully, but these errors were encountered: