Imagine I had a pipeline where step 1 created a Docker image and step 2 deployed it to a container registry.
I appreciate I could create a Docker image with both Java and Azure CLI installed and use that in one step but I'm interested if I could do it without that.
Without the "caches" sections, it doesn't look like the docker service in the example below keeps the image after the step has completed.
pipelines:
default:
- step:
image: adoptopenjdk/openjdk11
services:
- docker
# caches:
# - docker
script:
- docker pull docker/whalesay
- docker images
- step:
image: microsoft/azure-cli
services:
- docker
# caches:
# - docker
script:
- docker images
The whalesay image downloaded in step 1 is no longer in docker at the beginning of step 2.
If I add "caches" sections. It does seem to keep the downloaded docker image but the repository and tag details disappear?
"docker images" output from step 1:
REPOSITORY TAG IMAGE ID CREATED SIZE
docker/whalesay latest 6b362a9f73eb 4 years ago 247MB
"docker images" output from step 2:
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 6b362a9f73eb 4 years ago 247MB