Skip addition of #syntax directive when docker engine version >= 23.0.0
#1118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref# https://github.com/github/codespaces/issues/22031
Description of changes:
# syntax=docker/dockerfile:1.4which forces devcontainer cli to downloaddocker/dockerfile:1.4parser image from DockerHub registry. This is not required for docker engine version v23 onwards as the default moby buildkit version includesdocker/dockerfile:1.4or higher version of the parser. As part of this PR adding check to skip addition of#syntaxdirective when docker engine version >=23.0.0and rolling back Adding precautionary check for DockerHub registry availability in dev container cli #1113 changes.Changelog:
src/spec-node/containerFeatures.tsTo rollback changes made in Adding precautionary check for DockerHub registry availability in dev container cli #1113 and also introduced check to skip addition of#syntaxdirective when docker engine version >=23.0.0src/spec-node/devContainers.tsto fetch the docker engine version at the very beginning of dev container cli commanddevcontainer buildordevcontainer up.src/spec-node/utils.tsto rollback changes of Adding precautionary check for DockerHub registry availability in dev container cli #1113 and added a new attributedockerEngineVersionforDockerResolverParametersinterface.src/spec-shutdown/dockerUtils.tsto add a new function to fetch the docker engine version..github/workflows/test-docker-v20.ymlto demonstrate the behavior of dev container cli with the implementation of the new logic to skip the addition of#syntaxdirective in older docker engine versionv20.Checklist: