You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a very strange behavior with our Gitpod Setup using a custom Dockerfile.
We have a main branch A and a feature branch B. In B we're testing some new things so the Dockerfile differs slightly but is mainly equal to A. From time to time, we merge the main branch A into the feature branch B to keep it up to date.
In this case, the Docker Image is rebuild for B, but with the Dockerfile from A.
Sounds confusing? Yes it is :lau
I described the steps using a minimal example to show the problem:
Steps to reproduce
Create a project with these two files (main):
# .gitpod.Dockerfile
FROM gitpod/workspace-base:latest
RUN touch main-branch.info
# .gitpod.yml
image:
file: .gitpod.Dockerfile
Start a Gitpod workspace for main
-> ls ~ should show only main-branch.info
Create a Feature Branch (test-branch) and change the Dockerfile to:
# .gitpod.Dockerfile
FROM gitpod/workspace-base:latest
RUN touch main-branch.info
RUN touch test-branch.info
Start a Gitpod workspace for test-branch
-> ls ~ should show main-branch.info and test-branch.info
-> So far everything is fine
Make a change to Dockerfile in main:
# .gitpod.Dockerfile
FROM gitpod/workspace-base:latest
RUN touch main-branch-refactored.info
Start a Gitpod workspace for main
-> ls ~ should show only main-branch-refactored.info
Merge main into test-branch:
Start a Gitpod workspace for test-branch
-> ls ~ shows main-branch-refactored.info but not test-branch.info ⚠️
That's already confusing, as the code now doesn't represent the state anymore. So I tried rebuilding the image explicitely:
Open https://gitpod.io/#imagebuild/https://gitlab.com/<group>/<project>/-/tree/test-branch
-> Image is rebuild (you can see the logs, but you can see it's the wrong Dockerfile from main)
-> ls ~ shows main-branch-refactored.info but not test-branch.info ⚠️
The only thing that helps now is changing some line in the Dockerfile in test-branch. But this can't be the solution honestly.
Workspace affected
No response
Expected behavior
When the Dockerfile changes (no matter if directly in the branch or through a merge from main branch), the Image should be rebuild correctly from the branch's Dockerfile
Bug description
We have a very strange behavior with our Gitpod Setup using a custom Dockerfile.
We have a main branch A and a feature branch B. In B we're testing some new things so the Dockerfile differs slightly but is mainly equal to A. From time to time, we merge the main branch A into the feature branch B to keep it up to date.
In this case, the Docker Image is rebuild for B, but with the Dockerfile from A.
Sounds confusing? Yes it is :lau
I described the steps using a minimal example to show the problem:
Steps to reproduce
Start a Gitpod workspace for main
->
ls ~
should show onlymain-branch.info
Create a Feature Branch (test-branch) and change the Dockerfile to:
Start a Gitpod workspace for test-branch
->
ls ~
should showmain-branch.info
andtest-branch.info
-> So far everything is fine
Make a change to Dockerfile in main:
Start a Gitpod workspace for main
->
ls ~
should show onlymain-branch-refactored.info
Merge main into test-branch:
Start a Gitpod workspace for test-branch⚠️
->
ls ~
showsmain-branch-refactored.info
but not test-branch.infoThat's already confusing, as the code now doesn't represent the state anymore. So I tried rebuilding the image explicitely:
https://gitpod.io/#imagebuild/https://gitlab.com/<group>/<project>/-/tree/test-branch
-> Image is rebuild (you can see the logs, but you can see it's the wrong Dockerfile from main)
->
ls ~
showsmain-branch-refactored.info
but not test-branch.infoThe only thing that helps now is changing some line in the Dockerfile in test-branch. But this can't be the solution honestly.
Workspace affected
No response
Expected behavior
Example repository
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: