FROM nodered/node-red:3.1.3
RUN mkdir -p /data/gb/test
WORKDIR /data/gb/test
COPY test.txt /data/gb/test
This does create the folders in Node-RED /data folder.
But when I type into CLI … docker compose up -d … I get this error ?
Error response from daemon:
failed to create task for container: failed to create shim task:
OCI runtime create failed: runc create failed: unable to start container process:
exec: "./entrypoint.sh": stat ./entrypoint.sh: no such file or directory: unknown
The code below does work and creates the text file in that dir, but I cannot get it into /data ?
The error message caused by the WORKDIR instruction in your Dockerfile, which prevents the ENTRYPOINT command it inherited from the base image, to find the file in the current WORKDIR.
I am not really sure what this sentence is supposed to mean, but I guess you want to copy test.txt into the /data folder:
You know the cause that made the entrypoint fail. You need to eliminate the cause, or change the reference to the entrypoint. Even if you think you can’t change the entrypoint, the other option is still there. You can reset the workdir. Or change the path of the entrypoint using the instruction that @meyay gave you. By the way, you can always change everything. Even the entrypoint or command. The base image is just a base.
You could very easily search for the keyword on Google and find lots of examples and the documentation, but I can share my blogpost which shows a lot about what you need to know.