New computer? Install THIS first... 💻

Savvas Stephanides - Nov 23 '23 - - Dev Community

So! You just got a new laptop! It's right there sitting on your desk.

You excitedly switch it on and the logo of the computer's operating system shows up. A few seconds later, you can finally see the desktop.

A shiny new desktop with 2-3 icons. Nothing else. It's time to turn this laptop into a powerful developer machine.

So... let's install some developer tools for our laptop. What's the thing to install first? Surely you'll want to install a programming language, like Python or NodeJS! Or a database, like MySQL or Mongo!

Nop! You don't need to install any of these things. Just install Docker!

Docker is a tool that lets you install any of these things on little "containers". Think of them like little computers that live in your computer, with their own operating system, package manager etc.

For example, do you need to install the latest version of Python? Just enter this command into your Terminal:

docker pull python:latest
Enter fullscreen mode Exit fullscreen mode

This basically installs the instructions Docker needs to create a new "box" or "container" with its own operating system (Debian in this case) and Python installed. Such instructions are called an image.

Now to work with Python, all you need to do is create a new container using the python image you installed: Use this command to do so:

docker run -it python
Enter fullscreen mode Exit fullscreen mode

And just like that, you can work in Python! No Python installation required!

$ docker run -it python

Python 3.12.0 (main, Nov 21 2023, 17:38:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> print("Hello world!")
Hello world!
>>> 
Enter fullscreen mode Exit fullscreen mode

You can do the same for NodeJS!

$ docker run -it node 
Welcome to Node.js v21.2.0.
Type ".help" for more information.
> console.log("Hello world!")
Hello world!
Enter fullscreen mode Exit fullscreen mode

Or even MySQL:

docker run -e MYSQL_ROOT_PASSWORD=my-secret-pw -d -p 3306:3306 mysql
Enter fullscreen mode Exit fullscreen mode

There's more!

You can do all sorts of stuff you can do with Docker:

  • Create a separate environment with several services working together, using Docker Compose

  • Choose a specific version of a tool. For example if you need Python 3.7, just use docker pull python:3.7

And many many more things that will make your workflow so much easier! It definitely improved mine 1000%. I know it will improve yours too.

Learn more about Docker

Learn from a Docker Captain!

Ready to learn more about Docker? Docker Captain Francesco Ciulla (@francescoxx) will take you through everything you need to know about Docker in 57 minutes!

Docker Tutorial Crash Course! @DockerIo - YouTube

This is the first part of my Docker course/workshop, which will deeply explain how Docker works and what you can do with it.find Francesco: https://francesco...

favicon youtube.com

Docker Docs

Learn more about Docker with the documentation.

Explore the images available in Docker Hub

Docker Hub

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player