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

🚑 [HotFix] Fix dev environment for CPU Docker #3160

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yhna940
Copy link
Contributor

@yhna940 yhna940 commented Oct 12, 2024

What does this PR do?

This PR fixes the development environment setup for the CPU Docker configuration.

  • Removed useradd and USER user lines from Dockerfile to avoid permission issues with non-root user configuration.
  • Updated onCreateCommand in .devcontainer/devcontainer.json to include make installation, resolving dependency issues during setup.
  • Ensured necessary packages are installed with root privileges for a smoother development experience.

Motivation:

Currently, attempting to build the dev container with the CPU Docker image leads to permission errors during onCreateCommand, such as:

[433685 ms] Start: Run in container: /bin/sh -c apt-get update && apt-get install -y git && pip install -e '.[dev]'
Reading package lists... Done
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
[433789 ms] onCreateCommand failed with exit code 100. Skipping any further user-provided commands.
[433269 ms] Error: Command failed: /bin/sh -c apt-get update && apt-get install -y git && pip install -e '.[dev]'
[433269 ms]     at G7 (/root/.vscode-remote-containers/dist/dev-containers-cli-0.388.0/dist/spec-node/devContainersSpecCLI.js:235:130)
[433269 ms]     at async tm (/root/.vscode-remote-containers/dist/dev-containers-cli-0.388.0/dist/spec-node/devContainersSpecCLI.js:227:4483)
[433269 ms]     at async $w (/root/.vscode-remote-containers/dist/dev-containers-cli-0.388.0/dist/spec-node/devContainersSpecCLI.js:227:3828)
[433269 ms]     at async em (/root/.vscode-remote-containers/dist/dev-containers-cli-0.388.0/dist/spec-node/devContainersSpecCLI.js:227:2835)
[433269 ms]     at async GrA (/root/.vscode-remote-containers/dist/dev-containers-cli-0.388.0/dist/spec-node/devContainersSpecCLI.js:666:2752)
[433269 ms]     at async LrA (/root/.vscode-remote-containers/dist/dev-containers-cli-0.388.0/dist/spec-node/devContainersSpecCLI.js:665:8554)
[433269 ms]     at async /root/.vscode-remote-containers/dist/dev-containers-cli-0.388.0/dist/spec-node/devContainersSpecCLI.js:482:1190
[433273 ms] Exit code 1

This error occurs because onCreateCommand tries to update and install packages without sufficient permissions. By removing the non-root user setup, this PR ensures that the setup process completes without errors, providing a stable development environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant