[erlang-questions] Run cowboy in a docker image
Fri Mar 3 14:30:35 CET 2017
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.
More information about the erlang-questions