This project demonstrates how to run a Python script interactively inside a Docker container. The script generates a random number between a user-defined range.
rng.pyβ Python script to generate a random number.Dockerfileβ Docker configuration to run the script.
- Docker
-
Clone the repository:
git clone https://github.com/srikashyap24/Random-Number-Generator-with-Docker cd Random-Number-Generator-with-Docker
-
Build the Docker image:
docker build -t rng-app .
-
Run the container interactively:
docker run -it rng-app
You will be asked to enter a minimum and maximum number, and it will print a random number in that range.
Please enter the min number: 5
Please enter the max number: 15
9
- Writing a Python script with
randint - Creating and using a
Dockerfile - Running interactive containers using Docker
A simple exercise to understand interactive container usage with Docker and Python.
π οΈ Built with Python & Docker
π For learning and practice