loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
9.54k stars 346 forks source link

code directory not updating #1072

Open awesomescot opened 6 months ago

awesomescot commented 6 months ago

What happened?
Using the folder workspace, when I update the Dockerfile it is not reflected in DevPod. "Rebuild" and "Reset" don't seem to get the new code. I have to completely delete the workspace and recreate it in order to get the new code.

What did you expect to happen instead?
I would expect the code to get updated continuously. A rebuild or reset I would especially expect it to rebuild from the code in the local directory and not pull from cache.

How can we reproduce the bug? (as minimally and precisely as possible)
Create a workspace with kubernetes backend(although I think this might happen with others also). Build your image, which failed due to an error in Dockerfile. Change some code in your Dockerfile to fix error. Try to rebuild or reset. From the logs you can tell it's not getting the new Dockerfile code and continues to fail.

My devcontainer.json:

{
//  name of the dev container
  "name": "dev-repo-container",
//  Or use a Dockerfile here, more info: https://containers.dev/guide/dockerfile
  "build": {
    "dockerfile": "Dockerfile",
    "context": ".."
  },
  "initializeCommand": "mkdir -p /tmp/devcontainers/pypoetry",
  "postCreateCommand": "cd python && make install-dev",
  "mounts": [
    "source=${env:HOME}${env:USERPROFILE}/.aws,target=/root/.aws,type=bind",
    "source=${env:HOME}${env:USERPROFILE}/.ssh,target=/root/.ssh,type=bind",
    "source=/tmp/devcontainers/pypoetry,target=/root/.cache/pypoetry,type=bind",
  ]
}

Local Environment:

DevPod Provider:

Anything else we need to know?

scottwn commented 5 months ago

related https://github.com/loft-sh/devpod/issues/947

pascalbreuninger commented 2 months ago

Hi @awesomescot, this issue has slipped my attention. Are you starting your workspace from a local folder or a git repository URL?

bkneis commented 1 month ago

@awesomescot does this still happen for you with the latest devpod? I tried using the k8s operator and it worked

Benjamin-Etheredge commented 1 month ago

Running into the same issue. I'm on the latest version on windows. The docker provider will pickup the changes on a rebuild, but the kubernetes provider will not. It's not seeing changes to the devcontainer.json.

Benjamin-Etheredge commented 1 month ago

Further testing is showing that the underlying file changes are there, but it will not pickup any changes to devcontainer.json. It only uses the version of that file that was there at first creation.

bkneis commented 1 month ago

Thanks @Benjamin-Etheredge, I'll take another look and see if I can find why :+1: