@@ -211,6 +211,10 @@ FROM $_DEV_CONTAINERS_BASE_IMAGE AS dev_containers_target_stage
211
211
212
212
USER root
213
213
214
+ RUN --mount=type=cache,target=/var/cache/apt \\
215
+ --mount=type=cache,target=/var/lib/apt/lists \\
216
+ apt update
217
+
214
218
RUN mkdir -p ${ FEATURES_CONTAINER_TEMP_DEST_FOLDER }
215
219
COPY --from=dev_containers_feature_content_normalize /tmp/build-features/ ${ FEATURES_CONTAINER_TEMP_DEST_FOLDER }
216
220
@@ -306,20 +310,24 @@ echo "_REMOTE_USER_HOME=$(${getEntPasswdShellCommand(remoteUser)} | cut -d: -f6)
306
310
const dest = path . posix . join ( FEATURES_CONTAINER_TEMP_DEST_FOLDER , folder ! ) ;
307
311
if ( ! useBuildKitBuildContexts ) {
308
312
result += `COPY --chown=root:root --from=dev_containers_feature_content_source ${ source } ${ dest }
309
- RUN chmod -R 0755 ${ dest } \\
310
- && cd ${ dest } \\
311
- && chmod +x ./install.sh \\
312
- && ./install.sh
313
+ RUN --mount=type=cache,target=/var/cache/apt \\
314
+ --mount=type=cache,target=/var/lib/apt/lists \\
315
+ chmod -R 0755 ${ dest } \\
316
+ && cd ${ dest } \\
317
+ && chmod +x ./install.sh \\
318
+ && ./install.sh
313
319
314
320
` ;
315
321
} else {
316
- result += `RUN --mount=type=bind,from=dev_containers_feature_content_source,source=${ source } ,target=/tmp/build-features-src/${ folder } ${ useSELinuxLabel ? ',z' : '' } \\
317
- cp -ar /tmp/build-features-src/${ folder } ${ FEATURES_CONTAINER_TEMP_DEST_FOLDER } \\
318
- && chmod -R 0755 ${ dest } \\
319
- && cd ${ dest } \\
320
- && chmod +x ./install.sh \\
321
- && ./install.sh \\
322
- && rm -rf ${ dest }
322
+ result += `RUN --mount=type=cache,target=/var/cache/apt \\
323
+ --mount=type=cache,target=/var/lib/apt/lists \\
324
+ --mount=type=bind,from=dev_containers_feature_content_source,source=${ source } ,target=/tmp/build-features-src/${ folder } ${ useSELinuxLabel ? ',z' : '' } \\
325
+ cp -ar /tmp/build-features-src/${ folder } ${ FEATURES_CONTAINER_TEMP_DEST_FOLDER } \\
326
+ && chmod -R 0755 ${ dest } \\
327
+ && cd ${ dest } \\
328
+ && chmod +x ./install.sh \\
329
+ && ./install.sh \\
330
+ && rm -rf ${ dest }
323
331
324
332
` ;
325
333
}
@@ -333,21 +341,25 @@ RUN chmod -R 0755 ${dest} \\
333
341
if ( ! useBuildKitBuildContexts ) {
334
342
result += `
335
343
COPY --chown=root:root --from=dev_containers_feature_content_source ${ source } ${ dest }
336
- RUN chmod -R 0755 ${ dest } \\
337
- && cd ${ dest } \\
338
- && chmod +x ./devcontainer-features-install.sh \\
339
- && ./devcontainer-features-install.sh
344
+ RUN --mount=type=cache,target=/var/cache/apt \\
345
+ --mount=type=cache,target=/var/lib/apt/lists \\
346
+ chmod -R 0755 ${ dest } \\
347
+ && cd ${ dest } \\
348
+ && chmod +x ./devcontainer-features-install.sh \\
349
+ && ./devcontainer-features-install.sh
340
350
341
351
` ;
342
352
} else {
343
353
result += `
344
- RUN --mount=type=bind,from=dev_containers_feature_content_source,source=${ source } ,target=/tmp/build-features-src/${ feature . consecutiveId } ${ useSELinuxLabel ? ',z' : '' } \\
345
- cp -ar /tmp/build-features-src/${ feature . consecutiveId } ${ FEATURES_CONTAINER_TEMP_DEST_FOLDER } \\
346
- && chmod -R 0755 ${ dest } \\
347
- && cd ${ dest } \\
348
- && chmod +x ./devcontainer-features-install.sh \\
349
- && ./devcontainer-features-install.sh \\
350
- && rm -rf ${ dest }
354
+ RUN --mount=type=cache,target=/var/cache/apt \\
355
+ --mount=type=cache,target=/var/lib/apt/lists \\
356
+ --mount=type=bind,from=dev_containers_feature_content_source,source=${ source } ,target=/tmp/build-features-src/${ feature . consecutiveId } ${ useSELinuxLabel ? ',z' : '' } \\
357
+ cp -ar /tmp/build-features-src/${ feature . consecutiveId } ${ FEATURES_CONTAINER_TEMP_DEST_FOLDER } \\
358
+ && chmod -R 0755 ${ dest } \\
359
+ && cd ${ dest } \\
360
+ && chmod +x ./devcontainer-features-install.sh \\
361
+ && ./devcontainer-features-install.sh \\
362
+ && rm -rf ${ dest }
351
363
352
364
` ;
353
365
}
@@ -467,7 +479,7 @@ function updateFromOldProperties<T extends { features: (Feature & { extensions?:
467
479
} ;
468
480
}
469
481
470
- // Generate a base featuresConfig object with the set of locally-cached features,
482
+ // Generate a base featuresConfig object with the set of locally-cached features,
471
483
// as well as downloading and merging in remote feature definitions.
472
484
export async function generateFeaturesConfig ( params : ContainerFeatureInternalParams , dstFolder : string , config : DevContainerConfig , additionalFeatures : Record < string , string | boolean | Record < string , string | boolean > > ) {
473
485
const { output } = params ;
@@ -931,7 +943,7 @@ export async function processFeatureIdentifier(params: CommonParams, configPath:
931
943
} ;
932
944
return newFeaturesSet ;
933
945
} else {
934
- // We must have a tag, return a tarball URI for the tagged version.
946
+ // We must have a tag, return a tarball URI for the tagged version.
935
947
let newFeaturesSet : FeatureSet = {
936
948
sourceInformation : {
937
949
type : 'github-repo' ,
@@ -1151,7 +1163,7 @@ export async function fetchContentsAtTarballUri(params: { output: Log; env: Node
1151
1163
1152
1164
// Reads the feature's 'devcontainer-feature.json` and applies any attributes to the in-memory Feature object.
1153
1165
// NOTE:
1154
- // Implements the latest ('internalVersion' = '2') parsing logic,
1166
+ // Implements the latest ('internalVersion' = '2') parsing logic,
1155
1167
// Falls back to earlier implementation(s) if requirements not present.
1156
1168
// Returns a boolean indicating whether the feature was successfully parsed.
1157
1169
async function applyFeatureConfigToFeature ( output : Log , featureSet : FeatureSet , feature : Feature , featCachePath : string , computedDigest : string | undefined ) : Promise < boolean > {
0 commit comments