Create a simple Docker image from a Dockerfile and verify that it runs successfully.
Understand the build process and how a local image becomes a runnable container.
Check what images are already available before building a new one.
Command
docker imagesExpected Result
You should see a list of local Docker images.
Build a custom image from the Dockerfile in the current directory.
Command
docker build -t my-lab-app .Expected Result
Docker should complete the build and tag the image successfully.
Confirm that the image now exists locally.
Command
docker imagesExpected Result
You should see my-lab-app in the image list.
Start a container from the image and publish its port.
Command
docker run -d --name my-lab-app -p 3000:3000 my-lab-appExpected Result
Docker should return a container ID and start the app in the background.
Inspect container logs to verify successful startup.
Command
docker logs my-lab-appExpected Result
You should see startup output from the application.
You can build and run a custom Docker image.
You understand the relationship between Dockerfile, image, and container.