prasmussen / glot-run

API for running code inside docker containers
https://run.glot.io/
MIT License
147 stars 48 forks source link

Unable to start docker container. #20

Closed bharatpareek closed 7 years ago

bharatpareek commented 7 years ago

Hi, i am having some issues while setting up docker container using this repo. I'd really like to use this project. (I am new to both docker and erlang)

I cloned the repo and modified the devel.sh file with my own environment variables but I can't get the glot-run project working.

I build the docker image after modifying the evel.sh file, with the command docker build --tag=glotrun .

However, when I try to run it with the command docker run -it -p 8090:8090 glotrun, it fails with the following stack trace:

docker run -p 8090:8090 glotrun
Exec: /glot/erts-8.3/bin/erlexec -noshell -noinput +Bd -boot /glot/releases/1.2.1/glot -mode embedded -boot_var ERTS_LIB_DIR /glot/lib -config /glot/releases/1.2.1/sys.config -args_file /glot/releases/1.2.1/vm.args -pa -- foreground
Root: /glot
/glot
11:54:09.375 [info] Application lager started on node 'glot-run@127.0.0.1'
11:54:09.376 [info] Application cowboy started on node 'glot-run@127.0.0.1'
11:54:09.376 [info] Application uuid started on node 'glot-run@127.0.0.1'
11:54:09.376 [info] Application ssl_verify_fun started on node 'glot-run@127.0.0.1'
11:54:09.376 [info] Application hackney started on node 'glot-run@127.0.0.1'
11:54:09.377 [error] CRASH REPORT Process <0.560.0> with 0 neighbours exited with reason: bad argument in call to erlang:list_to_atom(false) in config:environment/0 line 22 in application_master:init/4 line 134
11:54:09.378 [info] Application glot exited with reason: bad argument in call to erlang:list_to_atom(false) in config:environment/0 line 22
Kernel pid terminated (application_controller) ({application_start_failure,glot,{bad_return,{{glot_app,start,[normal,[]]},{'EXIT',{badarg,[{erlang,list_to_atom,[false],[]},{config,environment,0,[{file

Crash dump is being written to: erl_crash.dump...{"Kernel pid terminated",application_controller,"{application_start_failure,glot,{bad_return,{{glot_app,start,[normal,[]]},{'EXIT',{badarg,[{erlang,list_to_atom,[false],[]},{config,environment,0,[{file,\"/glot-run/_build/default/lib/glot/src/config.erl\"},{line,22}]},{glot_app,start,2,[{file,\"/glot-run/_build/default/lib/glot/src/glot_app.erl\"},{line,13}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"}

Looking through the errors , it seems to be because my container's environment variables aren't properly set, but i did set all the values in devel.sh file and then built the container image.

I tried to pass the environment variables in command line and that container works but in that case what is the use of devel.sh file?

Please help.

prasmussen commented 7 years ago

devel.sh is only meant to be used while developing on glot-run and the Dockerfile is mainly there for automatic builds via Travis to see that everything compiles.

Personally I don't run glot-run itself inside docker. I use the make_release_docker.sh script (see comments inside the script) which uses docker to create an erlang release for linux, which can be started with bin/glot foreground after setting all the required environment variables.

bharatpareek commented 7 years ago

Oh.. I get it now :) Thanks a lot.

I was building a new image every time after making changes, I will try running 'glot-run' standalone on my machine without docker, will ask you if i stuck somewhere.

EDIT: But then what is the use of passing env var 'DOCKER_API_URL' if we are not running glot-run on docker? Is it used for running the glot language containers via API calls?

bharatpareek commented 7 years ago

Output of make_release_docker.sh

Unable to find image 'prasmussen/erlang-build:latest' locally
docker: Error response from daemon: repository prasmussen/erlang-build not found: does not exist or no pull access.

The docker image is not accessible.

EDIT: i will try building without docker.