Workspace Image Being Rebuilt Every Time When Using RUN in .gitpod.Dockerfile
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.8k
- Forks
- 1.4k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 5
Description
Bug description
In troubleshooting a recent ticket it appears there's a difference between our self-hosted instance and our SaaS offering in how image builds are handled.
On our SaaS instance when I have a .gitpod.yml file with:
image:
file: .gitpod.Dockerfile
vscode:
extensions:
- denoland.vscode-deno
- github.github-vscode-theme
#tasks:
# - before: d="$HOME/.slack"; md="/workspace/${d##*/}"; mkdir -p "$md" && rm -rf "$d" && ln -sf "$md" "$d" && exit
and a .gitpod.Dockerfile with the following:
FROM gitpod/workspace-base:latest
RUN echo "Hello world!"
RUN echo "I am causing the image to be rebuilt every single time...😩"
and I start a new workspace an image is built as expected. Once the workspace is spun up I then stop it, wait for it stop and then start it up again from the dashboard. During the start up the image is built up again.
On my self-hosted instance running 2022.08.0.10 using the same .gitpod.yml and .gitpod.Dockerfile when initially starting up a new workspace it builds the image as expected however after stopping the workspace and starting it again no image is built.
Steps to reproduce
- Create a test repository using the contents for the
.gitpod.ymland.gitpod.Dockerfilementioned above. - Ensure that the repository can be accessed from a self-hosted instance and our SaaS instance.
- Spin up a new workspace using your repository on both SaaS and your self-hosted instance.
- Observe on both the SaaS and self-hosted instances that the image is built.
- Stop both workspaces.
- Start up the workspace on the SaaS instance and observe that the image is built again.
- Start the workspace on the self-hosted instance and observe the image doesn't get built again.
Workspace affected
jimmybrancac-gitpodtest-l706okxw414
Expected behavior
I would expect both SaaS and self-hosted behave the same. Ideally the image isn't rebuilt as seen on the self-hosted instance.
Example repository
https://github.com/jimmybrancaccio/gitpod-test (please note this repository may be changed as it's one I use for testing and reproducing support issues)
Anything else?
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior using the .gitpod.yml and .gitpod.Dockerfile contents from the issue, starting by comparing workspace startup on SaaS and self-hosted instances. Verify that the initial image build occurs on both, then confirm that restarting a stopped SaaS workspace reuses the image instead of rebuilding it, matching self-hosted behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dockerfile
- Domain
- cloud, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100