Run a basic calculation using Python in docker container
Mayuresh Badgujar
TSE - CCNA | RHCSA | AWS | PKI | DMARC | Code Signing | Certificate Lifecycle Management
ubuntu $ docker run -it docker.io/python bash
Unable to find image 'python:latest' locally
latest: Pulling from library/python
fd0410a2d1ae: Pull complete
bf571be90f05: Pull complete
684a51896c82: Pull complete
fbf93b646d6b: Pull complete
784816c700bf: Pull complete
6128f660b1ce: Pull complete
69362144baed: Pull complete
Digest: sha256:137ae4b9f85671bd912a82a19b6966e2655f73e13579b5d6ad4edbddaaf62a9c
Status: Downloaded newer image for python:latest
root@5769aecfeced:/# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
root@5769aecfeced:/# python
Python 3.13.1 (main, Jan 24 2025, 19:39:23) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a=5
>>> b=3
>>> c=a+b
>>> print(c)
8
>>> exit
root@5769aecfeced:/# exit
exit
ubuntu $