[erlang-questions] Run cowboy in a docker image

Björn-Egil Dahlberg XB bjorn-egil.xb.dahlberg@REDACTED
Fri Mar 3 14:38:18 CET 2017


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
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions





More information about the erlang-questions mailing list