Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Find out why Dockerfile behaves differently between local and remote builds #857

Closed
gildub opened this issue Dec 10, 2021 · 4 comments
Closed

Comments

@gildub
Copy link
Contributor

gildub commented Dec 10, 2021

Dockerfile has seen a recent change added to be able to build image after move to NPM workspaces which implied nodejs bump.
The USER root stanza is needing during the build phase (in the two stages build approach).
But what is really surprising is the latter change is not needed when building image locally using either docker or buildah (on Linux Fedora 34).
At contrary when building remotely (on quay.io for instance) the stanza is needed or the image fails with following error:

12/9/2021, 3:13:56 PM npm ERR! code EACCES npm ERR! syscall open
12/9/2021, 3:13:56 PM npm ERR! path /opt/app-root/src/package-lock.json
12/9/2021, 3:13:56 PM npm ERR! errno -13
12/9/2021, 3:13:56 PM npm ERR! Error: EACCES: permission denied, open '/opt/app-root/src/package-lock.json' npm 

We need to find out why there is such different behavior between the remote or local builds and also ultimately not use USER root because there are no reason to.

@fabiendupont
Copy link
Collaborator

In fact, using USER root is ok, as long as you set it back to user 1001 (default id) afterwards. It is usually related to the build platform configuration and there's little you can do about it.

@gildub
Copy link
Contributor Author

gildub commented Dec 13, 2021

That's good to know, thanks for the information.

I would assume that the behavior of the similar issue we're facing with npm config set unsafe-perm true (see PR#853) is also dependent on the build plate-form. And since the user applied in the second stage of the build matters.

@gildub
Copy link
Contributor Author

gildub commented Jan 10, 2022

Cachito doesn't support workspaces, see containerbuildsystem/cachito#626 for more details

@yaacov
Copy link
Member

yaacov commented Jan 12, 2023

closing as new development is moving to:
https://github.com/kubev2v/forklift-console-plugin

@yaacov yaacov closed this as completed Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants