@devcontainers/cli
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -1256,3 +1256,2 @@ { | ||
"include": [ | ||
"codespaces-linux", | ||
"python-3", | ||
@@ -1259,0 +1258,0 @@ "python-3-anaconda", |
@@ -13,3 +13,3 @@ # Alpine | ||
| *Published images* | mcr.microsoft.com/vscode/devcontainers/base:alpine | | ||
| *Available image variants* | 3.15, 3.14, 3.13, 3.12 ([full list](https://mcr.microsoft.com/v2/vscode/devcontainers/base/tags/list)) | | ||
| *Available image variants* | 3.15, 3.14, 3.13 ([full list](https://mcr.microsoft.com/v2/vscode/devcontainers/base/tags/list)) | | ||
| *Published image architecture(s)* | x86-64, aarch64/arm64 | | ||
@@ -28,3 +28,3 @@ | *Works in Codespaces* | Yes | | ||
```json | ||
"args": { "VARIANT": "3.14" } | ||
"args": { "VARIANT": "3.15" } | ||
``` | ||
@@ -35,3 +35,2 @@ | ||
- `mcr.microsoft.com/vscode/devcontainers/base:alpine` (latest) | ||
- `mcr.microsoft.com/vscode/devcontainers/base:alpine-3.12` | ||
- `mcr.microsoft.com/vscode/devcontainers/base:alpine-3.13` | ||
@@ -38,0 +37,0 @@ - `mcr.microsoft.com/vscode/devcontainers/base:alpine-3.14` |
@@ -13,3 +13,3 @@ # C# (.NET) and MS SQL | ||
| *Published image architecture(s)* | x86-64 | | ||
| *Available image variants* | 3.1-focal, 5.0-focal, 6.0-focal | | ||
| *Available image variants* | 3.1-focal, 6.0-focal | | ||
| *Works in Codespaces* | Yes | | ||
@@ -16,0 +16,0 @@ | *Container host OS support* | Linux, macOS, Windows | |
@@ -13,3 +13,3 @@ # C# (.NET) | ||
| *Published images* | mcr.microsoft.com/vscode/devcontainers/dotnet | | ||
| *Available image variants* | 3.1 / 3.1-focal, 5.0 / 5.0-focal, 6.0 /6.0-bullseye, 6.0-focal, 5.0-bullseye, 3.1-bullseye ([full list](https://mcr.microsoft.com/v2/vscode/devcontainers/dotnet/tags/list)) | | ||
| *Available image variants* | 3.1 / 3.1-focal / 6.0 /6.0-bullseye, 6.0-focal, 3.1-bullseye ([full list](https://mcr.microsoft.com/v2/vscode/devcontainers/dotnet/tags/list)) | | ||
| *Published image architecture(s)* | x86-64, arm64/aarch64 for `bullseye` variants | | ||
@@ -38,3 +38,2 @@ | *Works in Codespaces* | Yes | | ||
- `mcr.microsoft.com/vscode/devcontainers/dotnet:3.1` (or `3.1-bullseye`, `3.1-focal` to pin to an OS version) | ||
- `mcr.microsoft.com/vscode/devcontainers/dotnet:5.0` (or `5.0-bullseye`, `5.0-focal` to pin to an OS version) | ||
- `mcr.microsoft.com/vscode/devcontainers/dotnet:6.0` (or `6.0-bullseye`, `6.0-focal` to pin to an OS version) | ||
@@ -41,0 +40,0 @@ |
@@ -13,3 +13,3 @@ # Ruby | ||
| *Published images* | mcr.microsoft.com/vscode/devcontainers/ruby | | ||
| *Available image variants* | 3 / 3-bullseye, 3.1 / 3.1-bullseye, 3.0 / 3.0-bullseye, 2 / 2-bullseye, 2.7 / 2.7-bullseye, 2.6 / 2.7-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster ([full list](https://mcr.microsoft.com/v2/vscode/devcontainers/ruby/tags/list)) | | ||
| *Available image variants* | 3 / 3-bullseye, 3.1 / 3.1-bullseye, 3.0 / 3.0-bullseye, 2 / 2-bullseye, 2.7 / 2.7-bullseye, 2.6 / 2.7-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster ([full list](https://mcr.microsoft.com/v2/vscode/devcontainers/ruby/tags/list)) | | ||
| *Published image architecture(s)* | x86-64, arm64/aarch64 for `bullseye` variants | | ||
@@ -40,3 +40,2 @@ | *Works in Codespaces* | Yes | | ||
- `mcr.microsoft.com/vscode/devcontainers/ruby:2.7` (or `2.7-bullseye`, `2.7-buster` to pin to an OS version) | ||
- `mcr.microsoft.com/vscode/devcontainers/ruby:2.6` (or `2.6-bullseye`, `2.6-buster` to pin to an OS version) | ||
@@ -43,0 +42,0 @@ You can decide how often you want updates by referencing a [semantic version](https://semver.org/) of each image. For example: |
{ | ||
"variants": ["3.15", "3.14", "3.13", "3.12"], | ||
"definitionVersion": "0.204.2", | ||
"variants": ["3.15", "3.14", "3.13"], | ||
"definitionVersion": "0.204.3", | ||
"build": { | ||
@@ -5,0 +5,0 @@ "latest": false, |
{ | ||
"definitionVersion": "2.0.0", | ||
"definitionVersion": "2.0.1", | ||
"build": { | ||
@@ -4,0 +4,0 @@ "latest": true, |
{ | ||
"variants": ["6.0-bullseye-slim", "6.0-focal", "5.0-bullseye-slim", "5.0-focal", "3.1-bullseye", "3.1-focal"], | ||
"definitionVersion": "0.203.0", | ||
"variants": ["6.0-bullseye-slim", "6.0-focal", "3.1-bullseye", "3.1-focal"], | ||
"definitionVersion": "0.203.1", | ||
"build": { | ||
@@ -13,4 +13,2 @@ "latest": "6.0-bullseye-slim", | ||
"6.0-bullseye-slim": ["linux/amd64", "linux/arm64"], | ||
"5.0-focal": ["linux/amd64"], | ||
"5.0-bullseye-slim": ["linux/amd64", "linux/arm64"], | ||
"3.1-focal": ["linux/amd64"], | ||
@@ -24,10 +22,2 @@ "3.1-bullseye": ["linux/amd64", "linux/arm64"] | ||
], | ||
"5.0-focal": [ | ||
"dotnet:${VERSION}-5.0", | ||
"dotnetcore:${VERSION}-5.0" | ||
], | ||
"5.0-bullseye-slim": [ | ||
"dotnet:${VERSION}-5.0-bullseye", | ||
"dotnetcore:${VERSION}-5.0-bullseye" | ||
], | ||
"3.1-focal": [ | ||
@@ -34,0 +24,0 @@ "dotnet:${VERSION}-3.1", |
{ | ||
"variants": ["3.1-bullseye", "3.0-bullseye", "2.7-bullseye", "2.6-bullseye", "3.1-buster", "3.0-buster", "2.7-buster", "2.6-buster"], | ||
"definitionVersion": "0.203.2", | ||
"variants": ["3.1-bullseye", "3.0-bullseye", "2.7-bullseye", "3.1-buster", "3.0-buster", "2.7-buster"], | ||
"definitionVersion": "0.203.3", | ||
"build": { | ||
@@ -11,7 +11,5 @@ "latest": "3.1-bullseye", | ||
"2.7-bullseye": ["linux/amd64", "linux/arm64"], | ||
"2.6-bullseye": ["linux/amd64", "linux/arm64"], | ||
"3.1-buster": ["linux/amd64"], | ||
"3.0-buster": ["linux/amd64"], | ||
"2.7-buster": ["linux/amd64"], | ||
"2.6-buster": ["linux/amd64"] | ||
"2.7-buster": ["linux/amd64"] | ||
}, | ||
@@ -36,3 +34,2 @@ "tags": [ | ||
], | ||
"2.6-bullseye": [ "ruby:${VERSION}-2.6" ], | ||
"3.1-buster": [ | ||
@@ -39,0 +36,0 @@ "ruby:${VERSION}-3-buster", |
{ | ||
"name": "vscode-dev-containers", | ||
"version": "0.234.0", | ||
"version": "0.236.0", | ||
"description": "VS Code Dev Containers: Definitions and Templates", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -36,2 +36,3 @@ "use strict"; | ||
const utils_1 = require("./utils"); | ||
const commonUtils_1 = require("../spec-common/commonUtils"); | ||
async function extendImage(params, config, imageName, pullImageOnError) { | ||
@@ -66,3 +67,3 @@ let cache; | ||
const args = []; | ||
if (params.useBuildKit) { | ||
if (params.buildKitVersion) { | ||
args.push('buildx', 'build', '--load'); | ||
@@ -178,3 +179,3 @@ for (const buildContext in featureBuildInfo.buildKitContexts) { | ||
}, Promise.resolve({})) : Promise.resolve({}))); | ||
// With Buildkit, we can supply an additional build context to provide access to | ||
// With Buildkit (0.8.0 or later), we can supply an additional build context to provide access to | ||
// the container-features content. | ||
@@ -184,8 +185,11 @@ // For non-Buildkit, we build a temporary image to hold the container-features content in a way | ||
// TODO generate an image name that is specific to this dev container? | ||
const buildKitVersionParsed = params.buildKitVersion ? (0, commonUtils_1.parseVersion)(params.buildKitVersion) : null; | ||
const minRequiredVersion = [0, 8, 0]; | ||
const useBuildKitBuildContexts = buildKitVersionParsed ? !(0, commonUtils_1.isEarlierVersion)(buildKitVersionParsed, minRequiredVersion) : false; | ||
const buildContentImageName = 'dev_container_feature_content_temp'; | ||
// When copying via buildkit, the content is accessed via '.' (i.e. in the context root) | ||
// When copying via temp image, the content is in '/tmp/build-features' | ||
const contentSourceRootPath = params.useBuildKit ? '.' : '/tmp/build-features/'; | ||
const contentSourceRootPath = useBuildKitBuildContexts ? '.' : '/tmp/build-features/'; | ||
const dockerfile = (0, containerFeaturesConfiguration_1.getContainerFeaturesBaseDockerFile)() | ||
.replace('#{nonBuildKitFeatureContentFallback}', params.useBuildKit ? '' : `FROM ${buildContentImageName} as dev_containers_feature_content_source`) | ||
.replace('#{nonBuildKitFeatureContentFallback}', useBuildKitBuildContexts ? '' : `FROM ${buildContentImageName} as dev_containers_feature_content_source`) | ||
.replace('{contentSourceRootPath}', contentSourceRootPath) | ||
@@ -196,3 +200,3 @@ .replace('#{featureBuildStages}', getFeatureBuildStages(featuresConfig, buildStageScripts, contentSourceRootPath)) | ||
.replace('#{copyFeatureBuildStages}', getCopyFeatureBuildStages(featuresConfig, buildStageScripts)); | ||
const dockerfilePrefixContent = `${params.useBuildKit ? '# syntax=docker/dockerfile:1.4' : ''} | ||
const dockerfilePrefixContent = `${useBuildKitBuildContexts ? '# syntax=docker/dockerfile:1.4' : ''} | ||
ARG _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/vscode/devcontainers/base:buster | ||
@@ -222,3 +226,3 @@ `; | ||
// For non-BuildKit, build the temporary image for the container-features content | ||
if (!params.useBuildKit) { | ||
if (!useBuildKitBuildContexts) { | ||
const buildContentDockerfile = ` | ||
@@ -254,3 +258,3 @@ FROM scratch | ||
}, | ||
buildKitContexts: params.useBuildKit ? { dev_containers_feature_content_source: dstFolder } : {}, | ||
buildKitContexts: useBuildKitBuildContexts ? { dev_containers_feature_content_source: dstFolder } : {}, | ||
}; | ||
@@ -257,0 +261,0 @@ } |
@@ -108,3 +108,3 @@ "use strict"; | ||
}, dockerPath, dockerComposePath); | ||
const useBuildKit = options.useBuildKit === 'never' ? false : (await (0, dockerUtils_1.dockerHasBuildKit)({ | ||
const buildKitVersion = options.useBuildKit === 'never' ? null : (await (0, dockerUtils_1.dockerBuildKitVersion)({ | ||
cliHost, | ||
@@ -133,3 +133,3 @@ dockerCLI: dockerPath, | ||
additionalCacheFroms: options.additionalCacheFroms, | ||
useBuildKit, | ||
buildKitVersion, | ||
}; | ||
@@ -136,0 +136,0 @@ } |
@@ -169,3 +169,3 @@ "use strict"; | ||
const args = []; | ||
if (buildParams.useBuildKit) { | ||
if (buildParams.buildKitVersion) { | ||
args.push('buildx', 'build', '--load', // (short for --output=docker, i.e. load into normal 'docker images' collection) | ||
@@ -172,0 +172,0 @@ '--build-arg', 'BUILDKIT_INLINE_CACHE=1'); |
@@ -38,3 +38,3 @@ /// <reference types="node" /> | ||
additionalCacheFroms: string[]; | ||
useBuildKit: boolean; | ||
buildKitVersion: string | null; | ||
} | ||
@@ -41,0 +41,0 @@ export interface ResolverResult { |
@@ -100,3 +100,3 @@ /// <reference types="node" /> | ||
export declare function getEvents(params: DockerCLIParameters | DockerResolverParameters, filters?: Record<string, string[]>): Promise<Exec>; | ||
export declare function dockerHasBuildKit(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters): Promise<boolean>; | ||
export declare function dockerBuildKitVersion(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters): Promise<string | null>; | ||
export declare function dockerCLI(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters, ...args: string[]): Promise<{ | ||
@@ -103,0 +103,0 @@ stdout: Buffer; |
@@ -7,3 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toDockerImageName = exports.toPtyExecParameters = exports.toExecParameters = exports.dockerPtyExecFunction = exports.dockerExecFunction = exports.dockerComposePtyCLI = exports.dockerComposeCLI = exports.dockerPtyCLI = exports.isPodman = exports.dockerContext = exports.dockerCLI = exports.dockerHasBuildKit = exports.getEvents = exports.createVolume = exports.listVolumes = exports.listContainers = exports.inspectVolumes = exports.inspectVolume = exports.inspectImage = exports.inspectContainers = exports.inspectContainer = void 0; | ||
exports.toDockerImageName = exports.toPtyExecParameters = exports.toExecParameters = exports.dockerPtyExecFunction = exports.dockerExecFunction = exports.dockerComposePtyCLI = exports.dockerComposeCLI = exports.dockerPtyCLI = exports.isPodman = exports.dockerContext = exports.dockerCLI = exports.dockerBuildKitVersion = exports.getEvents = exports.createVolume = exports.listVolumes = exports.listContainers = exports.inspectVolumes = exports.inspectVolume = exports.inspectImage = exports.inspectContainers = exports.inspectContainer = void 0; | ||
const commonUtils_1 = require("../spec-common/commonUtils"); | ||
@@ -135,12 +135,16 @@ const errors_1 = require("../spec-common/errors"); | ||
exports.getEvents = getEvents; | ||
async function dockerHasBuildKit(params) { | ||
async function dockerBuildKitVersion(params) { | ||
try { | ||
await dockerCLI(params, 'buildx', 'version'); | ||
return true; | ||
const result = await dockerCLI(params, 'buildx', 'version'); | ||
const versionMatch = result.stdout.toString().match(/(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<patch>[0-9]+)/); | ||
if (!versionMatch) { | ||
return null; | ||
} | ||
return versionMatch[0]; | ||
} | ||
catch { | ||
return false; | ||
return null; | ||
} | ||
} | ||
exports.dockerHasBuildKit = dockerHasBuildKit; | ||
exports.dockerBuildKitVersion = dockerBuildKitVersion; | ||
async function dockerCLI(params, ...args) { | ||
@@ -147,0 +151,0 @@ const partial = toExecParameters(params); |
{ | ||
"name": "@devcontainers/cli", | ||
"description": "Dev Containers CLI", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"bin": { | ||
@@ -77,3 +77,3 @@ "devcontainer": "devcontainer.js" | ||
"tar": "^6.1.11", | ||
"vscode-dev-containers": "https://github.com/microsoft/vscode-dev-containers/releases/download/v0.234.0/vscode-dev-containers-0.234.0.tgz", | ||
"vscode-dev-containers": "https://github.com/microsoft/vscode-dev-containers/releases/download/v0.236.0/vscode-dev-containers-0.236.0.tgz", | ||
"vscode-uri": "^3.0.3", | ||
@@ -80,0 +80,0 @@ "yargs": "~17.0.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
1440535
12152