gitpod-io / gitpod-io/gitpod

Workspace Image Being Rebuilt Every Time When Using RUN in .gitpod.Dockerfile

Open
#13,331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component: image-builder feature: workspace image build meta: never-stale team: workspace type: bug
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
  1. Create a test repository using the contents for the .gitpod.yml and .gitpod.Dockerfile mentioned above.
  2. Ensure that the repository can be accessed from a self-hosted instance and our SaaS instance.
  3. Spin up a new workspace using your repository on both SaaS and your self-hosted instance.
  4. Observe on both the SaaS and self-hosted instances that the image is built.
  5. Stop both workspaces.
  6. Start up the workspace on the SaaS instance and observe that the image is built again.
  7. 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

Front logo Front conversations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.