exp7
exp7
Objective:
To understand how a Dockerfile is structured and how to build a Docker image from it by containerizing a
simple Python application.
mkdir docker-experiment
cd docker-experiment
Create a new file named Dockerfile (without any extension) inside the docker-experiment directory
and add the following content:
FROM python:3.9-slim
WORKDIR /app
# Copy the local script into the container
COPY app.py .
This Dockerfile:
Run the following command in the terminal to build the Docker image:
Expected output:
docker rm <container_id>
6. Explored Docker commands like images, ps, stop, rm, and rmi.