@@ -283,13 +283,13 @@ async function getFeaturesBuildOptions(params: DockerResolverParameters, devCont
283283 await cliHost . writeFile ( envPath , Buffer . from ( builtinVariables . join ( '\n' ) + '\n' ) ) ;
284284
285285 // When copying via buildkit, the content is accessed via '.' (i.e. in the context root)
286- // When copying via temp image, the content is in '/opt /build-features'
287- const contentSourceRootPath = useBuildKitBuildContexts ? '.' : '/opt /build-features/' ;
286+ // When copying via temp image, the content is in '/tmp /build-features'
287+ const contentSourceRootPath = useBuildKitBuildContexts ? '.' : '/tmp /build-features/' ;
288288 const dockerfile = getContainerFeaturesBaseDockerFile ( )
289289 . replace ( '#{nonBuildKitFeatureContentFallback}' , useBuildKitBuildContexts ? '' : `FROM ${ buildContentImageName } as dev_containers_feature_content_source` )
290290 . replace ( '{contentSourceRootPath}' , contentSourceRootPath )
291291 . replace ( '#{featureBuildStages}' , getFeatureBuildStages ( featuresConfig , buildStageScripts , contentSourceRootPath ) )
292- . replace ( '#{featureLayer}' , getFeatureLayers ( featuresConfig , containerUser , remoteUser ) )
292+ . replace ( '#{featureLayer}' , getFeatureLayers ( featuresConfig , containerUser , remoteUser , useBuildKitBuildContexts , contentSourceRootPath ) )
293293 . replace ( '#{containerEnv}' , generateContainerEnvs ( featuresConfig ) )
294294 . replace ( '#{copyFeatureBuildStages}' , getCopyFeatureBuildStages ( featuresConfig , buildStageScripts ) )
295295 . replace ( '#{devcontainerMetadata}' , getDevcontainerMetadataLabel ( imageMetadata , common . experimentalImageMetadata ) )
@@ -349,7 +349,7 @@ ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder
349349 if ( ! useBuildKitBuildContexts ) {
350350 const buildContentDockerfile = `
351351 FROM scratch
352- COPY . /opt /build-features/
352+ COPY . /tmp /build-features/
353353 ` ;
354354 const buildContentDockerfilePath = cliHost . path . join ( dstFolder , 'Dockerfile.buildContent' ) ;
355355 await cliHost . writeFile ( buildContentDockerfilePath , Buffer . from ( buildContentDockerfile ) ) ;
@@ -394,9 +394,9 @@ function getFeatureBuildStages(featuresConfig: FeaturesConfig, buildStageScripts
394394 . map ( ( featureSet , i ) => featureSet . features
395395 . filter ( f => ( includeAllConfiguredFeatures || f . included ) && f . value && buildStageScripts [ i ] [ f . id ] ?. hasAcquire )
396396 . map ( f => `FROM mcr.microsoft.com/vscode/devcontainers/base:0-focal as ${ getSourceInfoString ( featureSet . sourceInformation ) } _${ f . id }
397- COPY --from=dev_containers_feature_content_normalize ${ path . posix . join ( contentSourceRootPath , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) } ${ path . posix . join ( '/opt /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) }
398- COPY --from=dev_containers_feature_content_normalize ${ path . posix . join ( contentSourceRootPath , getSourceInfoString ( featureSet . sourceInformation ) , 'common' ) } ${ path . posix . join ( '/opt /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'common' ) }
399- RUN cd ${ path . posix . join ( '/opt /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) } && set -a && . ./devcontainer-features.env && set +a && ./bin/acquire`
397+ COPY --from=dev_containers_feature_content_normalize ${ path . posix . join ( contentSourceRootPath , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) } ${ path . posix . join ( '/tmp /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) }
398+ COPY --from=dev_containers_feature_content_normalize ${ path . posix . join ( contentSourceRootPath , getSourceInfoString ( featureSet . sourceInformation ) , 'common' ) } ${ path . posix . join ( '/tmp /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'common' ) }
399+ RUN cd ${ path . posix . join ( '/tmp /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) } && set -a && . ./devcontainer-features.env && set +a && ./bin/acquire`
400400 )
401401 )
402402 ) . join ( '\n\n' ) ;
@@ -409,7 +409,7 @@ function getCopyFeatureBuildStages(featuresConfig: FeaturesConfig, buildStageScr
409409 . map ( f => {
410410 const featurePath = path . posix . join ( '/usr/local/devcontainer-features' , getSourceInfoString ( featureSet . sourceInformation ) , f . id ) ;
411411 return `COPY --from=${ getSourceInfoString ( featureSet . sourceInformation ) } _${ f . id } ${ featurePath } ${ featurePath } ${ buildStageScripts [ i ] [ f . id ] ?. hasConfigure ? `
412- RUN cd ${ path . posix . join ( '/opt /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) } && set -a && . ./devcontainer-features.env && set +a && ./bin/configure` : '' } `;
412+ RUN cd ${ path . posix . join ( '/tmp /build-features' , getSourceInfoString ( featureSet . sourceInformation ) , 'features' , f . id ) } && set -a && . ./devcontainer-features.env && set +a && ./bin/configure` : '' } `;
413413 } )
414414 )
415415 ) . join ( '\n\n' ) ;
0 commit comments