diff --git a/src/spec-node/dockerCompose.ts b/src/spec-node/dockerCompose.ts index de1ed35b0..da24c1981 100644 --- a/src/spec-node/dockerCompose.ts +++ b/src/spec-node/dockerCompose.ts @@ -541,7 +541,7 @@ while sleep 1 & wait $$!; do :; done", "-"${userEntrypoint.map(a => `, ${JSON.st security_opt:${securityOpts.map(securityOpt => ` - ${securityOpt}`).join('')}` : ''}${additionalLabels.length ? ` labels:${additionalLabels.map(label => ` - - ${label.replace(/\$/g, '$$$$')}`).join('')}` : ''}${mounts.length ? ` + - '${label.replace(/\$/g, '$$$$').replace(/'/g, '\'\'')}'`).join('')}` : ''}${mounts.length ? ` volumes:${mounts.map(m => ` - ${m.source}:${m.target}`).join('')}` : ''}${gpuResources}${volumeMounts.length ? ` volumes:${volumeMounts.map(m => ` diff --git a/src/test/configs/compose-image-without-features-minimal/.devcontainer/devcontainer.json b/src/test/configs/compose-image-without-features-minimal/.devcontainer/devcontainer.json index 0d78429ce..c681c45dd 100644 --- a/src/test/configs/compose-image-without-features-minimal/.devcontainer/devcontainer.json +++ b/src/test/configs/compose-image-without-features-minimal/.devcontainer/devcontainer.json @@ -4,6 +4,7 @@ "workspaceFolder": "/workspace", "postCreateCommand": "touch /postCreateCommand.txt", "remoteEnv": { - "TEST": "ENV" + "TEST": "ENV", + "TEST_ESCAPING": "{\n \"fo$o\": \"ba'r\"\n}" } } \ No newline at end of file diff --git a/src/test/configs/image/.devcontainer.json b/src/test/configs/image/.devcontainer.json index 0cb2f1701..b33c8035c 100644 --- a/src/test/configs/image/.devcontainer.json +++ b/src/test/configs/image/.devcontainer.json @@ -2,6 +2,8 @@ "image": "ubuntu:latest", "postCreateCommand": "touch /postCreateCommand.txt", "remoteEnv": { + "TEST": "ENV", + "TEST_ESCAPING": "{\n \"fo$o\": \"ba'r\"\n}", "LOCAL_PATH": "${localEnv:PATH}", "CONTAINER_PATH": "${containerEnv:PATH}" } diff --git a/src/test/imageMetadata.test.ts b/src/test/imageMetadata.test.ts index 5c7dc547f..c94ee3eb2 100644 --- a/src/test/imageMetadata.test.ts +++ b/src/test/imageMetadata.test.ts @@ -156,6 +156,8 @@ describe('Image Metadata', function () { const metadata = internalGetImageMetadata0(details, true, nullLog); assert.strictEqual(metadata.length, 1); assert.ok(metadata[0].remoteEnv); + assert.strictEqual(metadata[0].remoteEnv.TEST, 'ENV'); + assert.strictEqual(metadata[0].remoteEnv.TEST_ESCAPING, '{\n "fo$o": "ba\'r"\n}'); await shellExec(`docker exec ${response.containerId} test -f /postCreateCommand.txt`); await shellExec(`docker rm -f ${response.containerId}`); });