In an empty directory, I have run a sequence of commands shown in the following terminal capture:
$ echo -e "from alpine" > Dockerfile
$ docker build --tag alpine .
Sending build context to Docker daemon 2.048kB
Step 1/1 : from alpine
---> c059bfaa849c
Successfully built c059bfaa849c
Successfully tagged alpine:latest
$ docker image save -o alpine.tar alpine
$ echo -e "from alpine \nrun apk add --no-cache tini" > Dockerfile
$ docker build --tag tini .
Sending build context to Docker daemon 11.76MB
Step 1/2 : from alpine
---> c059bfaa849c
Step 2/2 : run apk add --no-cache tini
---> Using cache
---> e50ce83132ec
Successfully built e50ce83132ec
Successfully tagged tini:latest
$ docker image save -o tini.tar tini
$ ls -sh *.tar
12M alpine.tar 5.7M tini.tar
As expected, the image labeled tini builds a further layer above the one shared with alpine. However, the resulting saved file for the former image is smaller than that for the latter.
Expected is that the image saved in the former file is a superset of the latter, and therefore larger.
Why is this expectation not confirmed by observation?