Hi SDK community. I joked in the SDKPaint discord that I would try submitting some blogs. So, here I go. At work lately, a big task of mine has been turning old projects to allow them to use Docker. Outside of the world of software developers, it is less known as to what Docker is.
The very basics: Docker is meant to allow for faster delivery of applications. If you are running the same thing over and over again on virtual machines in a tech environment, you often have to reinstall and rerun everything every time. Docker images and containers make it so that a developer or user doesn't have to run it every single time. The developer first builds a docker image that gives all of the information to run the system. The steps so to speak. All the packages, code, system tools, how to install everything, etc. Then, this image is built. After it is built, it can be ran multiple times without having to reinstall everything every single time. This is a great improvement on speed.
An added bonus of doing this, is that everyone using the Docker Image is going to be going off the same base when testing code, so you won't have to worry about if everyone is running the same thing or not.
But what actually is Docker?: Docker is the Docker Engine and CLI (Command Line Interface). The Docker Engine is a daemon (a service running in the background) which manages the Docker containers. We interact with these Docker Containers using the CLI. It can be installed on Linux and MAC in a command line way or on Windows using Docker Desktop which is a little more annoying to use than the Command Line. Why is it more annoying? It doesn't tell you as much of what is going on directly, so it makes it more difficult to do basic things. Docker Desktop is basically running a tiny virtual machine anyway under it's hood to work like a CLI.
Docker and Root It's important to use docker safely. The user Docker in Linux is like the user root. For non Linux people, that means you have access to everything and can easily delete anything. So, it can be important to restrict access and add extra security inside of a Docker container or image. Because docker is like root, when you run docker commands if you're not the root user you have to run sudo before them in Linux.
How to try out Docker for yourself without installing anything! https://www.play-with-docker.com/ This site play with docker allows any user (with limited amounts of space. If they're out of space it wont let you login until they have server space available again). Create an account and login if you wanna try it out. It puts you into a Linux environment that already has all the necessary tools installed.
For a quick hello world type:
docker run busybox echo hello world
and it should send back
hello world
For an empty ubuntu container type:
docker run -it ubuntu
You are now in a container that is running ubuntu! -it is shorthand for -i -t. i tells Docker to connect us to the container's stdin and -t tells docker that we want to run a terminal.
You can do a lot more than that with docker, but that is a very, very basics.
Here are some resources to learn more: https://container.training/intro-selfpaced.yml.html#94 An introduction to containers by Bret Fisher that gives a much more detailed intro than what I gave here.
https://docs.docker.com/get-started/overview/ A complete docker overview from docker themselves.