Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the entrypoint script copy files to /var/www, when the image build could do that? #50

Open
kastl-ars opened this issue Dec 11, 2024 · 2 comments

Comments

@kastl-ars
Copy link
Contributor

Dear maintainers,

while trying to get OpenCost running on OpenShift, I had a look at the UI image.

Once thing I noticed is this line:

cp -rv /opt/ui/dist/* /var/www

Why is this not part of the image build process? Why is done at runtime (which requires write permissions to /var/www/ which causes problems on e.g. OpenShift?

Or, if I understand this line from the Dockerfile properly, why is this done again in the entrypoint?

COPY --from=builder /opt/ui/dist /var/www

https://github.com/opencost/opencost-ui/blob/main/Dockerfile#L30

Kind Regards,
Johannes

@mittal-ishaan
Copy link

Checked on it further. Seems like this was done to allow opencost-ui to run in a read only file system dbfea70

Also to the question on https://github.com/opencost/opencost-ui/blame/main/Dockerfile#L30
I am not sure how this line has been added there. as according to this commit the Dockerfile had overwritten that line this year itself. Then from where is blame telling me that it was a 2 year old change.

@kastl-ars
Copy link
Contributor Author

Seems like this was done to allow opencost-ui to run in a read only file system

How is adding a cp command to the entrypoint supposed to help with running on a read-only filesystem? Unless /var/www is being mounted from a volume and is writable?

Or am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants