@@ -283,13 +283,13 @@ async function getFeaturesBuildOptions(params: DockerResolverParameters, devCont
283
283
await cliHost . writeFile ( envPath , Buffer . from ( builtinVariables . join ( '\n' ) + '\n' ) ) ;
284
284
285
285
// 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/' ;
288
288
const dockerfile = getContainerFeaturesBaseDockerFile ( )
289
289
. replace ( '#{nonBuildKitFeatureContentFallback}' , useBuildKitBuildContexts ? '' : `FROM ${ buildContentImageName } as dev_containers_feature_content_source` )
290
290
. replace ( '{contentSourceRootPath}' , contentSourceRootPath )
291
291
. replace ( '#{featureBuildStages}' , getFeatureBuildStages ( featuresConfig , buildStageScripts , contentSourceRootPath ) )
292
- . replace ( '#{featureLayer}' , getFeatureLayers ( featuresConfig , containerUser , remoteUser ) )
292
+ . replace ( '#{featureLayer}' , getFeatureLayers ( featuresConfig , containerUser , remoteUser , useBuildKitBuildContexts , contentSourceRootPath ) )
293
293
. replace ( '#{containerEnv}' , generateContainerEnvs ( featuresConfig ) )
294
294
. replace ( '#{copyFeatureBuildStages}' , getCopyFeatureBuildStages ( featuresConfig , buildStageScripts ) )
295
295
. replace ( '#{devcontainerMetadata}' , getDevcontainerMetadataLabel ( imageMetadata , common . experimentalImageMetadata ) )
@@ -349,7 +349,7 @@ ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder
349
349
if ( ! useBuildKitBuildContexts ) {
350
350
const buildContentDockerfile = `
351
351
FROM scratch
352
- COPY . /opt /build-features/
352
+ COPY . /tmp /build-features/
353
353
` ;
354
354
const buildContentDockerfilePath = cliHost . path . join ( dstFolder , 'Dockerfile.buildContent' ) ;
355
355
await cliHost . writeFile ( buildContentDockerfilePath , Buffer . from ( buildContentDockerfile ) ) ;
@@ -394,9 +394,9 @@ function getFeatureBuildStages(featuresConfig: FeaturesConfig, buildStageScripts
394
394
. map ( ( featureSet , i ) => featureSet . features
395
395
. filter ( f => ( includeAllConfiguredFeatures || f . included ) && f . value && buildStageScripts [ i ] [ f . id ] ?. hasAcquire )
396
396
. 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`
400
400
)
401
401
)
402
402
) . join ( '\n\n' ) ;
@@ -409,7 +409,7 @@ function getCopyFeatureBuildStages(featuresConfig: FeaturesConfig, buildStageScr
409
409
. map ( f => {
410
410
const featurePath = path . posix . join ( '/usr/local/devcontainer-features' , getSourceInfoString ( featureSet . sourceInformation ) , f . id ) ;
411
411
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` : '' } `;
413
413
} )
414
414
)
415
415
) . join ( '\n\n' ) ;
0 commit comments