Build and run n8n custom with Docker : No such file or directory

Hi there,

I am trying to build and run a custom version of n8n with Docker. So I used the Dockerfile provided by the n8n’s team for custom version, the build works fine but when I execute docker run, it shows me this error :
[FATAL tini (7)] exec / failed: No such file or directory

Here the exact command I ran to get this error (in the root directory of my custom n8n version) :
docker run -it --rm --name n8n-similarity -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8n-custom

(I used docker build -t n8n-custom -f docker\images\n8n-custom\Dockerfile . to create the Docker image)

First I believed this error was due to my code modifications, so I also tried this build & run with the original n8n code, and the result is the same.

What am I doing wrong ?

Thank you in advance for your advices,


PS : my OS is Windows 10.

Hey @Asteda!

Does this post help Docker file for building image locally?

Hi @harshil1712 , thank you for your reply!

This post ends by creating the Dockerfile I just used, and it doesn’t work for me.

The Dockerfile has an instruction COPY docker/images/n8n-custom/ /, so I don’t understand why Docker can’t find the file…

I assume you run the command in the wrong folder. You have to run it in the n8n root folder.
So in this folder:

Thank you for your anwser @jan ,
I run these two commands in the n8n root folder.

Here the exact commands I run :
cd C:\Users\...\Developpement\n8n
docker build -t n8n-custom -f docker\images\n8n-custom\Dockerfile . (no error here, status: FINISHED)
docker run -it --rm --name n8n-similarity -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8n-custom

The last one gives me the error in my first message : [FATAL tini (7)] exec / failed: No such file or directory

If I understand the Dockerfile you created few months ago, it copies the into the Docker image’s root folder (/). Why it couldn’t find it next ?

Sorry sadly no idea. All I know is that it works generally correct. We build an image like that every night successfully:

I did also just pull the one we build 20h ago and that one started fine for me. So there must be something different with what you are doing and the only thing I can think of right now is that maybe Windows is the problem?

Hi @jan , thank you so much for your advice.

I tried to build and run my custom n8n version with Linux, and it worked fine.

For other people who could have the same problem, I am going to detail my situation :
I used an xubuntu VM (lsb_relase -d = Ubuntu 18.04.5 LTS). First I cloned my Github repository, and then I build it using docker build -t n8n-custom -f docker\images\n8n-custom\Dockerfile . inside the root folder of my custom n8n version.

When I tried to run my new image, I had this error :
There was an error initializing DB: "SQLITE_CANTOPEN: unable to open database file"
I just gave the rights access to docker group to the folder ~/.n8n.
Now everything is okay.
I don’t know why it’s not working on Windows, Oh Windows…

Thank you again for you help! Have a nice day :sunny:


Thanks, @Asteda for providing the solution :sparkling_heart:

(Windows is always weird, isn’t it :joy: )

1 Like

Great to hear that you were able to figure it out! Thanks for sharing the solution!

Now have fun!

1 Like