'Cached Docker images on Hosted Linux Preview agent

We are building docker image on VSTS by using VSTS Hosted Linux Preview agent. microsoft/aspnetcore-build image is used to build asp.net core application. Each time build is triggered, an agent is pulling microsoft/aspnetcore-build image from registry and it takes some time. We would like to avoid this, by specifying specific image pre-cached on agents.

Is there a list of container images that have been cached on Hosted Linux Preview agent? Such information is available for Hosted VS2017 agent, but not for Linux one.



Solution 1:[1]

No official article mentions it, I submit a user voice here: Docker image cache on Hosted linux agent that you can vote and follow.

Solution 2:[2]

According to this documentation the complete list can be found in the following documents:

(*) The above are permalinks to a specific snapshot of code (dated 2022-03-26). For the most current data, switch to the "main" branch in GitHub. Note that files may disappear from the 'main' branch when image gets deprecated.

As of 2022-03-26, both images include the same set of pre-cached docker images which are:

alpine:3.12
alpine:3.13
alpine:3.14
buildpack-deps:bullseye
buildpack-deps:buster
buildpack-deps:stretch
debian:10
debian:11
debian:9
moby/buildkit:latest
node:12
node:12-alpine
node:14
node:14-alpine
node:16
node:16-alpine
ubuntu:16.04
ubuntu:18.04
ubuntu:20.04

This can also be confirmed by adding a simple task to the pipeline that runs docker image list. Here's an example of the command's output ran on Ubuntu-16.04 agent (before it was deprecated):

/usr/bin/docker image list
REPOSITORY                                           TAG                 IMAGE ID            CREATED             SIZE
node                                                 10-alpine           955e0e1f1a41        11 days ago         80.5MB
node                                                 10                  bb78c02ca3bf        11 days ago         908MB
node                                                 12-alpine           afd897e3184b        11 days ago         85.2MB
node                                                 12                  b6f455933a97        11 days ago         913MB
buildpack-deps                                       stretch             c82dad0a8baf        2 weeks ago         835MB
debian                                               9                   92416e205014        2 weeks ago         101MB
debian                                               8                   955c8f8160c2        2 weeks ago         129MB
alpine                                               3.8                 c8bccc0af957        3 weeks ago         4.41MB
alpine                                               3.9                 82f67be598eb        3 weeks ago         5.53MB
alpine                                               3.10                af341ccd2df8        3 weeks ago         5.56MB
jekyll/builder                                       latest              4605d94a6b36        4 months ago        564MB
alpine                                               3.7                 6d1ef012b567        11 months ago       4.21MB
mcr.microsoft.com/azure-pipelines/node8-typescript   latest              9a948d360778        16 months ago       595MB

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 starian chen-MSFT
Solution 2