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

Not anymore persisting the /workspace content populated by custom .Dockerfile #19615

Closed
complyue opened this issue Apr 11, 2024 · 11 comments
Closed
Labels
team: team-engine type: bug Something isn't working

Comments

@complyue
Copy link

Bug description

Content populated under /workspace/ during custom .dockerfile building, ultimately get lost when the workspace is started.

Steps to reproduce

https://gitpod.io/#https://github.com/complyue/tour/blob/master/welcome.edh

Workspace affected

No response

Expected behavior

Haskell toolchain (GHCup and pieces it installs) installed during custom .Dockerfile building should persist as before.

Example repository

https://github.com/complyue/tour

Anything else?

It works before, not been touching the env until recently. /workspace should persist, right?

@svenefftinge
Copy link
Member

I don't think that has ever worked. The /workspace is a mount and with that anything that is coming from the docker file is overlayed. If you want to prefill the /workspace folder you need to make use of prebuilds.

@complyue
Copy link
Author

complyue commented May 16, 2024

I configured prebuilds, then the prebuild log shows failure, as things populated by my .Dockerfile (https://github.com/complyue/tour/blob/master/.gitpod.Dockerfile) are lost when my init task is run.

Isn't this a bug?

@axonasif
Copy link
Member

Hi @complyue, I see that you're writing files to /workspace from your dockerfile. Please use a different location (or leave the default location value) such as $HOME.

@complyue
Copy link
Author

Hi @axonasif , but per the doc, only /workspace will persist, $HOME will get reset every time the ws is restarted, that situation has changed? Haskell GHC toolchain is rather heavy (10 GB at least) not feasible to setup every time the ws is started.

@axonasif
Copy link
Member

axonasif commented May 17, 2024

@complyue that is true (for workspace restart/prebuilds) but not when you do it from a dockerfile, since that will bake your changes into the image/container itself in a static way.

@axonasif
Copy link
Member

axonasif commented May 17, 2024

BTW, I was referring to this part of your dockerfile code, my suggestion was to change the paths to somewhere else other than /workspace (e.g. $HOME)

@complyue
Copy link
Author

that will bake your changes into the image/container itself in a static way

my suggestion was to change the paths to somewhere else other than /workspace (e.g. $HOME)

@axonasif , persisted over ws restart is a requirement, can $HOME or some other dir you'd suggest warrant that nowadays? They used to be reset every time ws restarts.

@axonasif
Copy link
Member

They used to be reset every time ws restarts.

Yes, they still do. But your workspace docker image is static once it's built, so whatever you put in those dirs from your dockerfile will be there between restarts

@complyue
Copy link
Author

The essential requirement is that a branch don't trigger every user a toolchain setup (lasting about an hour) when he/she gp open it the first time. Prebuilds used to work for this scenario, by persisting Dockerfile populated toolchain payloads under /workspace.

Populating a user's own image may save him/her self that setup time for later ws startups, but won't help other users, I'm afraid.

@axonasif
Copy link
Member

@complyue prebuilds work differently now. Only members added to your Gitpod organization can access the prebuild: https://www.gitpod.io/docs/configure/repositories/prebuilds#prebuilds-are-only-available-to-organization-members

I took a look at your .gitpod.yml and .gitpod.Dockerfile, I think we can approach this problem in a different way. Can you raise a support ticket from here?

@complyue
Copy link
Author

@axonasif thanks for your kind advice! submitted.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: team-engine type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants