Photo by Robert Linder on Unsplash
Docker - I'm In
Running Docker Images - Python 3.11 in VS Code and Tcl in a Terminal
Table of contents
- Background
- Beginning the Installation
- Python Installation Complete
- Ready to Launch an Interactive Python Session in the Terminal
- Terminal Session Using Docker with VS Code
- Learning is a Journey
- It's time to create a Tcl/Tk Docker image ...
- Stop a Docker Container
- From the Documentation (docs.docker.com)
- Related Articles and Resources
Background
I know I was late to the party, but I now understand the value Docker brings to developing code.
I installed Docker several weeks ago after reading a number of articles that either referred to it or used it specifically. This article, "Python is About to Become 64% Faster - Python 3.10 vs Python 3.11 Benchmark," by Dario Radečić clearly demonstrates how easy it is to use Docker to create an image and deploy it using Visual Studio Code (VS Code).
The Docker extension in Visual Studio Code (VS Code) makes working with Docker an easy task and I'm hooked. While there is much learning to do, I'm looking forward to using Docker more so as part of my application development process.
Following the instructions in Dario's article, I managed to create a Python 3.11 image in Docker and begin a terminal session in VS Code as demonstrated in the following pictures.
Beginning the Installation
Python Installation Complete
Ready to Launch an Interactive Python Session in the Terminal
Terminal Session Using Docker with VS Code
Learning is a Journey
This may be a trivial matter for seasoned programmers, but I never felt the need to use Docker and I tend to be somewhat reluctant to adopt new technologies unless I see an immediate need to. With so many tools at our fingertips, it is increasingly difficult to discern between the ones that will actually help and pass the test of time.
It's time to create a Tcl/Tk Docker image ...
Visit the efrecon site on GitHub, download and extract the contents of the zip file, then run the command docker-tcl-master>docker build -t efrecon/tcl .
including the period at the end of the command!
Docker will begin building your image which may take some time depending on your internet connection.
After the build is complete, enter docker run -it --rm efrecon/tcl
in your terminal to run tcl as pictured below:
We can open another terminal window and enter docker ps
to see the processes running in docker.
Stop a Docker Container
Use the Docker Stop ***Container ID***
command to stop a Docker Container. We can stop the container from our example as pictured below:
From the Documentation (docs.docker.com)
a container:
- is a runnable instance of an image. You can create, start, stop, move, or delete a container using the DockerAPI or CLI.
- can be run on local machines, virtual machines or deployed to the cloud.
- is portable (can be run on any OS)
- Containers are isolated from each other and run their own software, binaries, and configurations.
Related Articles and Resources
- Docker Documentation: A great place to start and learn how to use Docker.
- The Python Tutorial: This tutorial will be sure to whet your appetite for Python.
- Docker: Explained Like You Are 5 - Everything you need to know about Docker, by Kuldeep Patel.
- When Tcl meets docker by Dr. Emmanuel Frécon.