=> [internal] load build definition from Dockerfile
=> CACHED [2/5] RUN apt-get update
=> [3/5] COPY package*.json ./
=> exporting to image
=> naming to docker.io/library/myapp:1.0
Note The dot at the end is the build context - Docker sends that entire directory to the daemon. Use .dockerignore to exclude node_modules and other heavy directories, or your builds will be painfully slow.
Note Without -a, this only removes dangling images (untagged). With -a, it removes ALL images not used by any container - this can delete base images you pulled but have not yet run. Use with caution.
prune imagesclean imagesremove unused imagesreclaim disk space
IMAGE CREATED BY SIZE
a1b2c3d4e5f6 CMD ["node" "server.js"] 0B
<missing> COPY . /app 45MB
<missing> RUN npm ci --omit=dev 85MB
Note This shows each layer and the command that created it. Great for diagnosing why an image is larger than expected - look for the biggest SIZE entries.
image historyimage layerslayer sizewhy is image big
Save & Load Images as Tarballs
Syntax
docker save -o<file.tar><image>docker load -i<file.tar>
Example
docker save -o myapp-v1.tar myapp:1.0# Transfer the file, then on the other machine:docker load -i myapp-v1.tar
Output
Loaded image: myapp:1.0
Note Useful for air-gapped environments with no registry access. The tarball includes all layers, so it can be large. Consider piping through gzip: docker save myapp:1.0 | gzip > myapp.tar.gz
save imageexport imageload imagetransfer imageoffline imageair-gapped