

To finish off the example, type print("Hello, World!") and watch as the magic happens. That means we are currently inside a docker container created from a python 3 docker image, running the python command.

Go ahead and run the following command: docker run -rm -it python:3 pythonĭon't worry, I'll explain that command in a second, but right now you are probably seeing something like this: It might take a few moments for this command to run for the first time Let's say you don't have Python installed in your machine - or at least not the latest version - and you need python to print "Hello, World!" in your terminal.

Docker run image basics install#
Important note: Before you continue, make sure you install docker using the recommended steps for your operating system. Let's go ahead and see an example of that in practice to make things clearer. Images are single files containing all the dependencies and configurations required to run a program, while containers are the instances of those images. Still lost? No worries, that's because you probably don't know what containers or images are. Alright, here's my definition of what docker is: Docker is a platform for creating and running containers from images. Here's Docker's definition, according to Wikipedia: Docker is a computer program that performs operating-system-level virtualization. If you're tired of hearing your coworkers praise Docker and its benefits at every chance they get, or you're tired of nodding your head and walking away every time you find yourself in one of these conversations, you've come to the right place.Īlso, if you are looking for a new excuse to wander off without getting fired, keep reading and you'll thank me later.
