@devcontainers/cli
Advanced tools
Comparing version 0.5.1 to 0.6.0
@@ -7,2 +7,8 @@ # Change Log | ||
### [0.6.0] | ||
- Handle undefined context. (https://github.com/microsoft/vscode-remote-release/issues/6815) | ||
- Avoid comment after ARG for Podman. (https://github.com/microsoft/vscode-remote-release/issues/6819) | ||
- Update to vscode-dev-containers 0.238.1. | ||
### [0.5.0] | ||
@@ -9,0 +15,0 @@ |
@@ -199,3 +199,3 @@ { | ||
"type": "string", | ||
"proposals": ["latest", "1.1", "1.0", "0.15"], | ||
"proposals": ["latest", "1.2", "1.1", "1.0", "0.15"], | ||
"default": "latest", | ||
@@ -202,0 +202,0 @@ "description": "Terraform version" |
{ | ||
"name": "vscode-dev-containers", | ||
"version": "0.238.0", | ||
"version": "0.238.1", | ||
"description": "VS Code Dev Containers: Definitions and Templates", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -7,3 +7,3 @@ { | ||
"parent": "typescript-node", | ||
"parentVariant": "14-bullseye", | ||
"parentVariant": "16-bullseye", | ||
"tags": [ | ||
@@ -15,3 +15,3 @@ "repos/microsoft/vscode:${VERSION}" | ||
"dependencies": { | ||
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:14-buster", | ||
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:16-buster", | ||
"imageLink": "https://github.com/microsoft/vscode-dev-containers", | ||
@@ -18,0 +18,0 @@ "manual": [{ |
@@ -143,3 +143,3 @@ /// <reference types="node" /> | ||
export declare function getDockerfile(config: DevContainerFromDockerfileConfig): string; | ||
export declare function getDockerComposeFilePaths(cliHost: FileHost, config: DevContainerFromDockerComposeConfig, envForComposeFile?: NodeJS.ProcessEnv, cwdForDefaultFiles?: string): Promise<string[]>; | ||
export declare function getDockerComposeFilePaths(cliHost: FileHost, config: DevContainerFromDockerComposeConfig, envForComposeFile: NodeJS.ProcessEnv, cwdForDefaultFiles: string): Promise<string[]>; | ||
export {}; |
@@ -88,32 +88,29 @@ "use strict"; | ||
} | ||
if (cwdForDefaultFiles) { | ||
const envComposeFile = envForComposeFile === null || envForComposeFile === void 0 ? void 0 : envForComposeFile.COMPOSE_FILE; | ||
if (envComposeFile) { | ||
return envComposeFile.split(cliHost.path.delimiter) | ||
const envComposeFile = envForComposeFile === null || envForComposeFile === void 0 ? void 0 : envForComposeFile.COMPOSE_FILE; | ||
if (envComposeFile) { | ||
return envComposeFile.split(cliHost.path.delimiter) | ||
.map(composeFile => cliHost.path.resolve(cwdForDefaultFiles, composeFile)); | ||
} | ||
try { | ||
const envPath = cliHost.path.join(cwdForDefaultFiles, '.env'); | ||
const buffer = await cliHost.readFile(envPath); | ||
const match = /^COMPOSE_FILE=(.+)$/m.exec(buffer.toString()); | ||
const envFileComposeFile = match && match[1].trim(); | ||
if (envFileComposeFile) { | ||
return envFileComposeFile.split(cliHost.path.delimiter) | ||
.map(composeFile => cliHost.path.resolve(cwdForDefaultFiles, composeFile)); | ||
} | ||
try { | ||
const envPath = cliHost.path.join(cwdForDefaultFiles, '.env'); | ||
const buffer = await cliHost.readFile(envPath); | ||
const match = /^COMPOSE_FILE=(.+)$/m.exec(buffer.toString()); | ||
const envFileComposeFile = match && match[1].trim(); | ||
if (envFileComposeFile) { | ||
return envFileComposeFile.split(cliHost.path.delimiter) | ||
.map(composeFile => cliHost.path.resolve(cwdForDefaultFiles, composeFile)); | ||
} | ||
} | ||
catch (err) { | ||
if (!(err && (err.code === 'ENOENT' || err.code === 'EISDIR'))) { | ||
throw err; | ||
} | ||
catch (err) { | ||
if (!(err && (err.code === 'ENOENT' || err.code === 'EISDIR'))) { | ||
throw err; | ||
} | ||
} | ||
const defaultFiles = [cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.yml')]; | ||
const override = cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.override.yml'); | ||
if (await cliHost.isFile(override)) { | ||
defaultFiles.push(override); | ||
} | ||
return defaultFiles; | ||
} | ||
return []; | ||
const defaultFiles = [cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.yml')]; | ||
const override = cliHost.path.resolve(cwdForDefaultFiles, 'docker-compose.override.yml'); | ||
if (await cliHost.isFile(override)) { | ||
defaultFiles.push(override); | ||
} | ||
return defaultFiles; | ||
} | ||
exports.getDockerComposeFilePaths = getDockerComposeFilePaths; |
@@ -208,3 +208,3 @@ "use strict"; | ||
const dockerfilePrefixContent = `${useBuildKitBuildContexts ? '# syntax=docker/dockerfile:1.4' : ''} | ||
ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder # will be overridden by build args passed to CLI | ||
ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder | ||
`; | ||
@@ -211,0 +211,0 @@ // Build devcontainer-features.env file(s) for each features source folder |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { ResolverResult, DockerResolverParameters } from './utils'; | ||
@@ -6,5 +7,6 @@ import { Workspace } from '../spec-utils/workspaces'; | ||
import { CollapsedFeaturesConfig } from '../spec-configuration/containerFeaturesConfiguration'; | ||
import path from 'path'; | ||
export declare function openDockerComposeDevContainer(params: DockerResolverParameters, workspace: Workspace, config: DevContainerFromDockerComposeConfig, idLabels: string[]): Promise<ResolverResult>; | ||
export declare function getRemoteWorkspaceFolder(config: DevContainerFromDockerComposeConfig): string; | ||
export declare function getBuildInfoForService(composeService: any): { | ||
export declare function getBuildInfoForService(composeService: any, cliHostPath: typeof path, localComposeFiles: string[]): { | ||
image: string | undefined; | ||
@@ -11,0 +13,0 @@ build?: undefined; |
@@ -121,6 +121,6 @@ "use strict"; | ||
// exported for testing | ||
function getBuildInfoForService(composeService) { | ||
function getBuildInfoForService(composeService, cliHostPath, localComposeFiles) { | ||
// composeService should taken from readDockerComposeConfig | ||
// the 'build' property can be a string or an object (https://docs.docker.com/compose/compose-file/build/#build-definition) | ||
var _a; | ||
var _a, _b; | ||
const image = composeService.image; | ||
@@ -146,3 +146,3 @@ const composeBuild = composeService.build; | ||
dockerfilePath: (_a = composeBuild.dockerfile) !== null && _a !== void 0 ? _a : 'Dockerfile', | ||
context: composeBuild.context, | ||
context: (_b = composeBuild.context) !== null && _b !== void 0 ? _b : cliHostPath.dirname(localComposeFiles[0]), | ||
target: composeBuild.target, | ||
@@ -163,3 +163,3 @@ } | ||
let dockerfile = null; | ||
const serviceInfo = getBuildInfoForService(composeService); | ||
const serviceInfo = getBuildInfoForService(composeService, cliHost.path, localComposeFiles); | ||
if (serviceInfo.build) { | ||
@@ -479,3 +479,4 @@ const { context, dockerfilePath, target } = serviceInfo.build; | ||
try { | ||
const { stdout } = await (0, dockerUtils_1.dockerComposeCLI)(params, ...composeGlobalArgs, 'config'); | ||
const partial = (0, dockerUtils_1.toExecParameters)(params, 'dockerComposeCLI' in params ? await params.dockerComposeCLI() : undefined); | ||
const { stdout } = await (0, dockerUtils_1.dockerComposeCLI)({ ...partial, print: 'onerror' }, ...composeGlobalArgs, 'config'); | ||
const stdoutStr = stdout.toString(); | ||
@@ -482,0 +483,0 @@ params.output.write(stdoutStr); |
@@ -52,3 +52,3 @@ /// <reference types="node" /> | ||
output: Log; | ||
print?: boolean | 'continuous'; | ||
print?: boolean | 'continuous' | 'onerror'; | ||
} | ||
@@ -55,0 +55,0 @@ export interface PartialPtyExecParameters { |
{ | ||
"name": "@devcontainers/cli", | ||
"description": "Dev Containers CLI", | ||
"version": "0.5.1", | ||
"version": "0.6.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.238.0/vscode-dev-containers-0.238.0.tgz", | ||
"vscode-dev-containers": "https://github.com/microsoft/vscode-dev-containers/releases/download/v0.238.1/vscode-dev-containers-0.238.1.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
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
1453416