You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
ASYD/ASYD_Docker/docker-04/dangling/build.sh

24 lines
627 B

#!/bin/bash
IMAGE_NAME=$(basename $(pwd))
echo "***"
echo "*** creating an image from Dockerfile.v1 with name my_alpine"
docker build . -f Dockerfile.v1 -t $IMAGE_NAME
echo "***"
echo "***listing all images"
docker image ls
read -n 1 -p "press any key to create an image with the same name from a slightly changed Dockerfile.v2"
docker build . -f Dockerfile.v2 -t $IMAGE_NAME
echo "***"
echo "*** listing all images"
docker image ls
echo "***"
echo "*** note the 'dangling' image named <none>:<none>"
echo "*** to list only dangling images use: docker images --filter dangling=true"
docker images --filter dangling=true