Run cowboy in a docker image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Run cowboy in a docker image

Benjamin Adams-2
Has anyone had luck running cowboy in docker with mk?

I have tried with
RUN make
CMD ["make", "run"]
Also
CMD ["make", "run", "&"]
Also
Erlang execution line with console or start

Has anyone had any luck with this?

Ben

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run cowboy in a docker image

Nathaniel Waisbrot
You're really asking a Docker question here.


> CMD ["make", "run"]


The list form of CMD is similar to execl(3). You should give an absolute path to "make".

> CMD ["make", "run", "&"]


This is passing a literal '&' to the 'make' executable (if you corrected its path). To accomplish what you're trying for, you'd use the string form:

CMD make run &

that line gets interpreted by the shell, so you don't need the absolute path and you can do other shell-ish things. But you wouldn't want to background the job because then the foreground job would be finished and Docker would terminate immediately, taking down your server process.


> Has anyone had any luck with this?


Yes; built a number of services with Cowboy and ran them in containers. I built a release inside the container and then ran that in foreground mode.

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run cowboy in a docker image

Björn-Egil Dahlberg XB
Short docker-erlang primer.

Uses cowboy and rebar3 in the example.

https://github.com/psyeugenic/docker-erlang

Not saying it's *the* way to do it - just a way to do it.

// Björn-Egil

On 03/03/2017 02:30 PM, Nathaniel Waisbrot wrote:

> You're really asking a Docker question here.
>
>
>> CMD ["make", "run"]
>
> The list form of CMD is similar to execl(3). You should give an absolute path to "make".
>
>> CMD ["make", "run", "&"]
>
> This is passing a literal '&' to the 'make' executable (if you corrected its path). To accomplish what you're trying for, you'd use the string form:
>
> CMD make run &
>
> that line gets interpreted by the shell, so you don't need the absolute path and you can do other shell-ish things. But you wouldn't want to background the job because then the foreground job would be finished and Docker would terminate immediately, taking down your server process.
>
>
>> Has anyone had any luck with this?
>
> Yes; built a number of services with Cowboy and ran them in containers. I built a release inside the container and then ran that in foreground mode.
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...