Release using docker not finding env.sh script

Hi everyone, I’ve been trying to use Mix releases to deploy an umbrella app composed of one phoenix server, one ETS app, and five other sub-apps.
I’ve been trying to deploy it using a Dockerfile and based on the current documentation:
https://elixirschool.com/blog/releasing-an-umbrella-app-with-docker-and-mix-release
https://hexdocs.pm/phoenix/releases.html

My Dockerfile looks like this: dockerfile · GitHub
the image is built successfully, but when I try to run the image, I get the following error:
: not found2: /app/releases/0.1.0/env.sh:
Even tough, the file env.sh currently exists and its contents are:
#!/bin/sh

Sets and enables heart (recommended only in daemon mode)

case $RELEASE_COMMAND in

daemon*)

HEART_COMMAND=“$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND”

export HEART_COMMAND

export ELIXIR_ERL_OPTIONS=“-heart”

;;

*)

;;

esac

Set the release to work across nodes.

RELEASE_DISTRIBUTION must be “sname” (local), “name” (distributed) or “none”.

export RELEASE_DISTRIBUTION=name

export RELEASE_NODE=<%= @release.name %>

I didn’t find anything about this issue on internet, does anyone have ever gone through something like this before?

Hi, I just had the same problem and found this thread when searching for a solution. I’m guessing this may be too late for OP, but here is my solution for future reference:

I’m building a Linux docker image from a Windows host. My issue was that env.sh.eex had CRLF line endings, which somehow caused problems when the (empty) lines in env.sh were read/executed in the docker image.

Replacing the CRLF endings with LF solved my issue.

3 Likes