Closed RomaDevWorld closed 1 year ago
I'll build and test it myself as soon as I get home
Now I've tried it. But it can't be built.
I see the error from your code is WORKDIR
, this should be set before copy as the path has not been created yet. Based on an example from the documentation of Node.js
=> ERROR [3/4] WORKDIR /usr/src/app 0.3s
------
> [3/4] WORKDIR /usr/src/app:
------
Dockerfile:5
--------------------
3 | COPY package*.json /usr/src/app
4 |
5 | >>> WORKDIR /usr/src/app
6 |
7 | COPY . .
--------------------
ERROR: failed to solve: mkdir /var/lib/docker/overlay2/4f3hdvvfmul830brkuavvrsl6/merged/usr/src/app: not a directory
Anyway, I appreciate your little suggestion. I'm currently tweaking the way Docker works as you mentioned above.
Ok, good luck!
There is an official Docker image for node.js: https://hub.docker.com/_/node/ So there is no need to install it manually.
I recommend building the image before merging.