# Docker - I'm In

## Background
I know I was late to the party, but I now understand the value [Docker](https://docs.docker.com/?utm_source=docker&utm_medium=inproductad&utm_campaign=20-11nurturecli_docs) brings to developing code.

I installed [Docker](https://docs.docker.com/?utm_source=docker&utm_medium=inproductad&utm_campaign=20-11nurturecli_docs) 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](https://towardsdatascience.com/python-is-about-to-become-64-faster-python-3-10-vs-python-3-11-benchmark-3a6abcc25b90)," by Dario Radečić clearly demonstrates how easy it is to use [Docker](https://docs.docker.com/?utm_source=docker&utm_medium=inproductad&utm_campaign=20-11nurturecli_docs) 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](https://docs.docker.com/?utm_source=docker&utm_medium=inproductad&utm_campaign=20-11nurturecli_docs) 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](https://docs.docker.com/?utm_source=docker&utm_medium=inproductad&utm_campaign=20-11nurturecli_docs) and begin a terminal session in VS Code as demonstrated in the following pictures.

## Beginning the Installation
![Python-Docker 2022-05-01 071943.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651422433290/uOSt5vFAT.png align="left")

## Python Installation Complete
![Python-Docker-Installation Complete 2022-05-01 071943.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651422451899/9pCa8WH0B.png align="left")

## Ready to Launch an Interactive Python Session in the Terminal
![Python-Docker-Run-VS-Code 2022-05-01 071943.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651422470572/NvEu7Iq7N.png align="left")

## Terminal Session Using Docker with VS Code
![Python-VS-Code-Terminal Session 2022-05-01 124128.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651423424290/9-C2QQuDQ.png align="left")

## 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](https://github.com/efrecon/docker-tcl) ... 
Visit the [efrecon](https://github.com/efrecon/docker-tcl) 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:

![Tcl Shell Running in Docker 2022-05-03 221550.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651630606260/A8_usuffq.png align="left")

We can open another terminal window and enter ```docker ps``` to see the processes running in docker.

![Tcl process running in Docker 2022-05-03 220934.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651630261584/PlV5Oc2bO.png align="left")

## 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:

![Stop Docker Session 2022-05-03 223533.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651632265771/nyoz5FPu8.png align="left")


## From the [Documentation](https://docs.docker.com/get-started/) (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](https://docs.docker.com/?utm_source=docker&utm_medium=inproductad&utm_campaign=20-11nurturecli_docs):  A great place to start and learn how to use Docker.
- [The Python Tutorial](https://docs.python.org/3.11/tutorial/):  This tutorial will be sure to whet your appetite for Python.
- [Docker:  Explained Like You Are 5](https://python.plainenglish.io/docker-explained-to-a-5-year-old-ffc4e6197fe0) - Everything you need to know about Docker, by Kuldeep Patel.
- [When Tcl meets docker](https://tcl.tk/community/tcl2016/assets/talk51/when-tcl-meets-docker-paper.pdf) by Dr. Emmanuel Frécon.

