To see how Docker adds layers to an image, let's make a change to the adderservice and rebuild the container.
For example, we could modify our adderservice/index.js like so:
console.log('HI!')
const wiring = require('./wiring')
const service = require('./service')()
wiring(service)
Then we can rebuild the container with this command:
$ docker build -t adderservice
Let's see how that's affected the images by running the following:
$ docker images
The output would look something like the following:
REPOSITORY TAG IMAGE ID CREATED SIZE
adderservice latest 7809fbfaaf33 3 seconds ago 226 MB
<none> <none> 83c1f429d9c5 13 minutes ago 226 MB
node slim 9be176e26d04 3 weeks ago 216 MB
Notice the image labeled <none>. This is the previous version of our adderservice container, which was displaced because we built another image with the same tag name. The second build command has moved the repository name and the latest tag to our new image.
We can now rerun the history command like so:
$ docker history adderservice
We should be able to see how our layers have changed, as shown in the following screenshot:
![](assets/22b9d193-3026-4b74-8a9d-513099fc4038.png)
If we look at the IMAGE column, we can see that the ID for the uppermost two layers is different. This means that the difference between these two images is just these two layers. Notice also that these layers consist of a total of 1.475 KB. It is important to understand that when this change to a container is deployed, on the delta, in this case only 1.475 KB will be changed.