Issues Running Custom Image built with custom apps

Hi All,

I could use some assistance.

I am attempting to install ERPNext with custom apps using Docker Compose. Though I am running into a few problems.

I cloned the main branch from here to generate the containers -

Using the compose.yaml config always fails to run the short and long queues for some reason. The following error is thrown:

Please make sure that Redis Queue runs @ redis://. Redis reported error: Error 99 connecting to localhost:6379. Cannot assign requested address.

Though if I do a netstat the mentioned port doesn’t seem to be used.

Anyway running the containers with the default image in pwd.yml seems to generate everything fine and I can access my ERPNext frontend on port 8080.

docker compose -p pwd -f pwd.yml up

My main issue is with the custom image not running the frontend container.
The error thrown when trying to start the container is:

exec /usr/local/bin/nginx-entrypoint.sh: no such file or directory

Here are the steps to replicate:

  • Docker version 24.0.6, build ed223bc
  • Windows 10 Home 22H2 19045.4046
  1. Creating an environment variable for apps.json and pass it as an argument to docker build.

apps.json:

[
  {
    "url": "https://github.com/frappe/erpnext.git",
    "branch": "version-15"
  },
  {
    "url": "https://github.com/frappe/hrms.git",
    "branch": "version-15"
  },
  {
    "url": "https://github.com/frappe/lms.git",
    "branch": "main"
  },
  {
    "url": "https://github.com/frappe/wiki.git",
    "branch": "master"
  }
]

Environment Variable:

export APPS_JSON_BASE64=$(base64 -w 0 development/apps.json)
  1. Build a custom image passing the above variable as an argument.
docker build \
  --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \
  --build-arg=FRAPPE_BRANCH=version-15 \
  --build-arg=PYTHON_VERSION=3.11.6 \
  --build-arg=NODE_VERSION=18.18.2 \
  --build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64 \
  --tag=siegang1/erpnext-custom:1.0.0 \
  --file=images/custom/Containerfile .
  1. Log into Docker and push the image.
docker login
docker push siegang1/erpnext-custom:1.0.0.
  1. Since only the pwd.yml config worked for me - replace all instances of image: frappe/erpnext:v15.15.0 with image: siegang1/erpnext-custom:1.0.0

  2. Run the containers with

docker compose -p pwd -f pwd.yml up
  1. All containers run fine except for the frontend container

I apologies if its a silly issue or if I missed a step mentioned in the docs. I’m not too well versed with Docker.

Thank you.

May I have some assistance with this please?

I have run in to the same issue with raven and gameplan custom image. Did you find the solution ?

Hi,

It seemed it was an issue with the environment variables not getting passed to the .yml config file when starting the containers.

My work around was to create a new .yml config using the override configs provided in the repo.

docker compose -f compose.yaml -f overrides/compose.noproxy.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml config > docker-compose.yml

All containers except for the frontend container start up fine.

So still can’t get the containers to run successfully in that regard.

I opened a ticket here "/usr/local/bin/nginx-entrypoint.sh: no such file or directory" in frontend container · Issue #1367 · frappe/frappe_docker · GitHub

waiting for a response…

Ok so the issue with this seems to be that I was building my docker images on a Windows machine. It formats the nginx-entrypoint.shfile with Windows carriage returns that makes the file unable to execute on Linux.

Its mentioned in the following issue here: Custom Image - exec /usr/local/bin/nginx-entrypoint.sh: no such file or directory · Issue #1292 · frappe/frappe_docker · GitHub

However changing the file format to UTF-8 didn’t seem to resolve the issue, I had to run dos2unix on the file then rebuild the custom image.

All containers are running without issues now it seems.

To summarize -

  1. Generate the .yml config file using the overrides to pass the relevant DB and Redis variables.
  2. Make sure the nginx-entrypoint.sh file is in the correct format when building on Windows.