I think the Docker for Absolute Beginner course would benefit from the below clarification under “Basic Docker commands” section:
Can a VM image be removed after the VM is created?
Yes — once a virtual machine (VM) is created and running, you can delete its base image without affecting the VM.
Why?
In virtualization platforms like VirtualBox, VMware, Hyper-V, or cloud platforms like AWS EC2:
- A VM image (e.g., .vmdk, .iso, or an AMI) is just a template to create the VM.
- Once the VM is created, it has its own virtual disk, separate from the original image.
So:
- The VM becomes self-contained.
- The image is no longer needed for that VM to run.
- You can delete the original image, and the VM will keep working.
Example:
- You download ubuntu.iso
- You create a new VM using this ISO
- The VM creates its own disk (e.g., ubuntu-disk.vdi)
- You can delete ubuntu.iso, and the VM will still work
How Docker is different:
In Docker:
- The image is still tightly linked to the container
- A container depends on the image it was created from
- You cannot delete the image until all containers based on it are removed