Docker image build failed #1716

Closed
opened 2020-04-18 05:12:20 +00:00 by py_crash · 4 comments

I try to build manually the docker image for the frontend using:

$ docker build ./

However it fails in the step 5:

Removing intermediate container d632dce2b204
 ---> 393b39b0abf9
Step 4/5 : ADD nginx.conf /etc/nginx/nginx.conf
 ---> be61f775eda7
Step 5/5 : COPY dist /usr/share/nginx/html
COPY failed: stat /var/lib/docker/tmp/docker-builder224423382/dist: no such file or directory

I try to build manually the docker image for the frontend using: ``` $ docker build ./ ``` However it fails in the step 5: ``` Removing intermediate container d632dce2b204 ---> 393b39b0abf9 Step 4/5 : ADD nginx.conf /etc/nginx/nginx.conf ---> be61f775eda7 Step 5/5 : COPY dist /usr/share/nginx/html COPY failed: stat /var/lib/docker/tmp/docker-builder224423382/dist: no such file or directory ```
py_crash changed title from Docker image buld failed to Docker image build failed 2020-04-18 05:12:33 +00:00
Owner

You need to build the frontend first with yarn run build. The build fails in your case because it cannot find the built frontend files.

You need to build the frontend first with `yarn run build`. The build fails in your case because it cannot find the built frontend files.

I think it would be good to add a Docker multistage build for this matter. So you don't have to install node.js and yarn on the host machine but build it in a separate stage and copy it over. I'll take a look at this and open a PR for this!

I think it would be good to add a Docker multistage build for this matter. So you don't have to install node.js and yarn on the host machine but build it in a separate stage and copy it over. I'll take a look at this and open a PR for this!
Owner

Sounds like aa good idea!

Sounds like aa good idea!
Owner

With #113 merged, the frontend Dockerfile now has a build stage which makes it possible to build the docker image without needing to build the frontend first.

With #113 merged, the frontend Dockerfile now has a build stage which makes it possible to build the docker image without needing to build the frontend first.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1716
No description provided.