diff --git a/src/spec-node/containerFeatures.ts b/src/spec-node/containerFeatures.ts index 37586ea76..50cb419c2 100644 --- a/src/spec-node/containerFeatures.ts +++ b/src/spec-node/containerFeatures.ts @@ -39,7 +39,7 @@ export async function extendImage(params: DockerResolverParameters, config: Subs // no feature extensions - return return { updatedImageName: [imageName], - imageMetadata: imageBuildInfo.metadata, + imageMetadata: getDevcontainerMetadata(imageBuildInfo.metadata, config, extendImageDetails?.featuresConfig), imageDetails: async () => imageBuildInfo.imageDetails, labels: extendImageDetails?.labels, }; 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 8f240d13a..0d78429ce 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 @@ -2,6 +2,7 @@ "dockerComposeFile": "docker-compose.yml", "service": "app", "workspaceFolder": "/workspace", + "postCreateCommand": "touch /postCreateCommand.txt", "remoteEnv": { "TEST": "ENV" } diff --git a/src/test/configs/image/.devcontainer.json b/src/test/configs/image/.devcontainer.json index d04e6f2c7..0cb2f1701 100644 --- a/src/test/configs/image/.devcontainer.json +++ b/src/test/configs/image/.devcontainer.json @@ -1,5 +1,6 @@ { "image": "ubuntu:latest", + "postCreateCommand": "touch /postCreateCommand.txt", "remoteEnv": { "LOCAL_PATH": "${localEnv:PATH}", "CONTAINER_PATH": "${containerEnv:PATH}" diff --git a/src/test/imageMetadata.test.ts b/src/test/imageMetadata.test.ts index 8e70a7d25..b4dc52ac1 100644 --- a/src/test/imageMetadata.test.ts +++ b/src/test/imageMetadata.test.ts @@ -156,6 +156,7 @@ describe('Image Metadata', function () { const metadata = internalGetImageMetadata0(details, true, nullLog); assert.strictEqual(metadata.length, 1); assert.ok(metadata[0].remoteEnv); + await shellExec(`docker exec ${response.containerId} test -f /postCreateCommand.txt`); await shellExec(`docker rm -f ${response.containerId}`); }); });