Pull the Ubuntu Docker Image:
First, download the official Ubuntu Docker image from the Docker Hub by running the following command:
docker pull ubuntu
Start an Interactive Container:
Create an interactive container based on the Ubuntu image:
docker run -it ubuntu /bin/bash
You’ll be logged in as the root user inside the container.
Update the Container: Update the package lists within the container:
apt-get update
Install Python: For Python 3.x, run:
apt-get install python3
Exit the Container: Type exit to leave the container.