This project demonstrates how to use Docker's multi-stage build feature to create a lightweight and secure container image using a distroless base image for your application.
- Prerequisites
- Getting Started
- Project Structure
- Building the Docker Image
- Running the Container
- Contributing
- License
Before you begin, ensure you have the following prerequisites installed on your system:
- Docker: Install Docker
To get started with this project, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/docker-multistage-distroless.git cd docker-multistage-distroless
Project Structure
The project structure is minimal and contains the following key files:
Dockerfile: Defines the multi-stage Docker build process. calculator.py: An example Python application for demonstration purposes. Feel free to replace calculator.py with your own application code.
Building the Docker Image
To build the Docker image, run the following command from the project's root directory:
docker build -t your-image-name .
Running the Container
After building the Docker image, you can run a container based on the image: