Skip to content

[IMP] travis2docker: Preinstall VS Code server and add devcontainer.json - #240

Merged
moylop260 merged 2 commits into
Vauxoo:mainfrom
vauxoo-dev:main-devcontainer-vscode-moy
Aug 19, 2026
Merged

[IMP] travis2docker: Preinstall VS Code server and add devcontainer.json#240
moylop260 merged 2 commits into
Vauxoo:mainfrom
vauxoo-dev:main-devcontainer-vscode-moy

Conversation

@moylop260

@moylop260 moylop260 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Reimplements the idea of #169 (credit to @antonag32) on top of the current main, extended with build-time pre-installation of the VS Code tooling. Related to #158.

Everything is opt-in with the environment variable DEPLOYV_VSCODE=1, so vim/terminal users are not affected at all (no extra build time, no extra files):

DEPLOYV_VSCODE=1 travisfile2dockerfile git@github.com:Vauxoo/forecast.git 8.0

When enabled:

  • The Dockerfile pre-installs the VS Code server and extensions at build time, so attaching VS Code to the container does not download/install anything live:
    • The server version is pinned to the commit of the local code binary (code --version), falling back to the latest stable when code is not in PATH. If the pinned server ever mismatches the client, VS Code just downloads its own version as usual (graceful fallback).
    • The extensions come from the existing templates/.vscode/extensions.json (single source of truth, no duplicated list) and are installed into ~/.vscode-server/extensions, which is server-version independent, so they survive client upgrades.
    • The download handles both x86_64 and arm64 images.
  • A .devcontainer.json is generated next to the Dockerfile pointing to the image built by 10-build.sh (instead of rebuilding from the Dockerfile, which would lose --build-env-args), with remoteUser: odoo, workspaceFolder: /home/odoo/instance and python.analysis.extraPaths for Odoo source navigation. Opening the generated folder in VS Code offers Reopen in Container automatically.

Differences vs #169: rebased onto the pathlib/deployv-only codebase, remoteUser is odoo instead of root, uses image instead of dockerFile, the extension list is not duplicated, gated behind the env var, and covered by tests.

  • TODO: Check vscode opening a .py file not found interpreter python error

Opt-in with the DEPLOYV_VSCODE=1 environment variable so vim/terminal
users do not pay the extra build time downloading VS Code artifacts:

- The Dockerfile pre-installs the VS Code server pinned to the commit of
  the local 'code' binary (falling back to the latest stable) and the
  extensions of templates/.vscode/extensions.json at build time, so
  attaching VS Code to the container does not install anything live
- Generate a .devcontainer.json next to the Dockerfile pointing to the
  image built by 10-build.sh so VS Code offers 'Reopen in Container'

Based on the idea of Vauxoo#169 by @antonag32
Related to Vauxoo#158
@moylop260
moylop260 merged commit 53651df into Vauxoo:main Aug 19, 2026
19 of 20 checks passed
@moylop260
moylop260 deleted the main-devcontainer-vscode-moy branch August 19, 2026 17:05
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