Skip to content

Skip addition of #syntax directive when docker engine version >= 23.0.0 - #1118

Merged
Álvaro Rausell Guiard (AlvaroRausell) merged 2 commits into
devcontainers:mainfrom
v-Kaniska244:directive-syntax-further-changes
Dec 8, 2025
Merged

Álvaro Rausell Guiard (AlvaroRausell) merged 2 commits into
devcontainers:mainfrom
v-Kaniska244:directive-syntax-further-changes

Conversation

@v-Kaniska244

@v-Kaniska244 Kaniska (v-Kaniska244) commented Dec 5, 2025 •

Copy link
Copy Markdown
Contributor

Ref# https://github.com/github/codespaces/issues/22031

Description of changes:

  • The above codespace availability incident was created to address the multiple outages noticed in DockerHub registry which caused downtime for codepaces as devcontainer up and build commands injects syntax directive # syntax=docker/dockerfile:1.4 which forces devcontainer cli to download docker/dockerfile:1.4 parser image from DockerHub registry. This is not required for docker engine version v23 onwards as the default moby buildkit version includes docker/dockerfile:1.4 or higher version of the parser. As part of this PR adding check to skip addition of #syntax directive when docker engine version >= 23.0.0 and rolling back Adding precautionary check for DockerHub registry availability in dev container cli #1113 changes.

Changelog:

  • Changed src/spec-node/containerFeatures.ts To rollback changes made in Adding precautionary check for DockerHub registry availability in dev container cli #1113 and also introduced check to skip addition of #syntax directive when docker engine version >= 23.0.0
  • Changes made in src/spec-node/devContainers.ts to fetch the docker engine version at the very beginning of dev container cli command devcontainer build or devcontainer up.
  • Changes in src/spec-node/utils.ts to rollback changes of Adding precautionary check for DockerHub registry availability in dev container cli #1113 and added a new attribute dockerEngineVersion for DockerResolverParameters interface.
  • Changes made in src/spec-shutdown/dockerUtils.ts to add a new function to fetch the docker engine version.
  • Added a new workflow .github/workflows/test-docker-v20.yml to demonstrate the behavior of dev container cli with the implementation of the new logic to skip the addition of #syntax directive in older docker engine version v20.

Checklist:

  • All checks are passed.
@v-Kaniska244 Kaniska (v-Kaniska244) changed the title Adding check to skip addition of #syntax directive when docker engine version < 23.0.0 Dec 5, 2025
@v-Kaniska244 Kaniska (v-Kaniska244) changed the title Skip addition of #syntax directive when docker engine version < 23.0.0 Dec 5, 2025
@v-Kaniska244
Kaniska (v-Kaniska244) marked this pull request as ready for review December 5, 2025 17:42
@v-Kaniska244
Kaniska (v-Kaniska244) requested a review from a team as a code owner December 5, 2025 17:42

@chrmarti Christof Marti (chrmarti) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@AlvaroRausell
Álvaro Rausell Guiard (AlvaroRausell) merged commit f2a9b10 into devcontainers:main Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants