This repository contains a Python script that generates the Fibonacci series and runs it within a Docker container.
- Clone the repository:
git clone git@github.com:Fuan200/fibonacci_docker_python.git
- Run the script:
python fibo_docker.py
- Enter the value to
input_user.
Note: The value input_user only can be a integer.
- Build the image to the proyect:
docker build -t <name_of_image> .
If you receive an error similar to the following when starting the last command:
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
Run the following command first:
sudo docker build -t <name_of_image> .
- Run the container:
docker run -it --name <container_name> fibo_docker
-
Write a number (this only will works one time)
-
Start the container:
docker start <container_name>
- Exec the container:
docker exec -it <container_name> /bin/bash
You will be on the terminal container.
- Run the script:
python fibo_dock.py
- To exit to terminal container:
exit
- Fuan200 - Fuan200