Docker - Legacy Intro Guide
Docker is another tool developers can add to their arsenal when it comes to testing and deploying software. Just like working with containers, virtual machines, and remote servers, you will be able to turn that entire operating system or environment into an image file! That's powerful.
Disclaimer: As time goes on, this article and the methods may be outdated!
Before We Get Started:
The operating system I installed Docker is Windows 8.1. I am not that interested in Windows 10, I'll wait for the next Windows version and upgrade my PC as well. For other versions such as Linux and MAC you can follow the documentation on the main Docker website. The documentation is alright and will help you get up to speed. This tutorial will be going over the installation for Windows 8.1 and legacy Docker Toolbox, doing containers, images, checking networks, and the basics. If you want to learn about creating multiple networks, swarm containers, and pushing images to a live server, that may come later (but you could just read the documentation or find a much more experienced person for this technology).
If you are also using a version of Windows below Windows 10, then the early parts of this tutorial will be helpful. You should skip the installation part and move onto the latter about creating containers and whatnot.
Also, Docker has tons of commands so I recommend you get these files for reference that can be found anywhere.
These are very helpful!
My Favorite Thing About Docker:
Although in this tutorial I did not go over configuring and installing an operating system and running it in a container and packing it as an image with custom dependencies like Python, or PHP installed it is possible. You can download an image like CentOS and load it into a container and access the operating system directly! You can then use apt-get or yum, etc. and even run programs like nano and basically a full-blown working Linux distro within a Docker container! That's crazy! I love it, but I have not played around that much with it except for simple things. I may go over that in another tutorial, but it should be easy for you to get once you go through this tutorial. You would just run a command with the container name and then the program like nano or vim etc.
Then once you are done in the container you can turn it into an image and always know that whatever you did will be exactly what it was on the other machine! Docker is basically a cross-platform software for software developers with everything development operations (DevOps).
A Helpful Video:
I was planning to make a video, but there are good ones already! I found this one extremely helpful.
Installing Legacy Docker Toolbox:
I'll be using images to show the steps with a brief explanation of what is happening. How I will be explaining the process if by having my thoughts above the picture with the explanation.
On Windows 8.1 you may have to disable Hyper-V, so head to the start menu and type "Windows Features", you should get an option for windows features on and off or similar. Look for Hyper-V and disable it and restart your computer. This part is necessary because of incompatibility issues with the virtual VM (OracleBox that comes with Docker Toolbox). Windows 10 Pro (I believe) supports virtualization natively so you don't have to do this.
Once you restart head on over to the Docker website and install the legacy toolbox: Docker Toolbox
Install the one for Windows and start installing it onto your computer. Please make sure you have over at least 20GB as when you start installing images to run on Docker they will quickly eat up a lot of storage.
Once you got it installed, please also install bash. You may have to later configure the environment variable on your computer for bash in order to get the quickstart for docker running. You can easily do this by going to my computer and advanced an adding an additional environment variable for the location of your bash, bin file.
Once you got that, you should have a shortcut for Docker Quickstart Terminal, in which we will use to quickly do Docker stuff.
You will see something like this when you have Docker ready. After waiting for a while (like 1 minute or more, it was for me) you will finally see the Moby Dick on the terminal like below.
Here I show that you can also use docker straight in the virtual machine as well.
Our first command we can run is ls which will list our objects depending on the preappened command like docker container ls or docker network ls, etc.
We can now verify if our installation is working like below.
Now that we have Docker installed and running like a champ, we can check our docker version and start creating containers and whatnot.
In the below step, you may have to set some rules so that you can use your local connection port to be shared with the virtual port. You will then be able to visit your virtual machines webpage locally on your computer. Notice where to change and configure the Network adapter below.
You can see that our web server on our virtual machine is able to communicate with our local machine as we can see the HTTP requests in our terminal to the left.
Here we are checking the status of our running container, which is like a process (iirc).
Below we are creating multiple containers with different images. Be aware that these are all on the main bridge network.
We can check the information about our multiple running containers or just one.
We can also check the stats/status of our containers and see how much CPU and memory they are taking. This can help with optimizations.
Below we can directly access our container's image with run -it. See how we are able to see the files of the container with nginx installed and using bash!
Below we will now run a command to remove all our containers. Notice how you can write a short name of the container ID and remove multiple of them like so.
Now we will look into the network. A network can run multiple containers that communicate with each other.
Below we are examining how the DNS of the network utilizes the round-robin scheduling technique.
Again, we can use the --help command to see more about Networks in Docker. Please also read the documentation because you can do so much more that what we have done in this tutorial.
Creating Your Own Images:
Before you get started with creating your own images, you need to log in or sign up and register to Docker and then go to your Repository page. You will then be using login and logout for accessing your Docker account. Make an account at Docker Hub
Below I was working with an assignment for an online course, but I wanted to demonstrate how powerful Docker is. You can create full working products, web applications, scripts, and much more that run off of a single image. There is no need for developers to fiddle or hassle with download, installing, and configuring packages and software anymore with the help of Docker!
Docker Is Powerful:
Now that you have Docker, and I hope I was a bit helpful on explaining what Docker actually is, you can deploy your own custom images to quickly test your product on different operating systems, deploy elsewhere, use it in cloud services, and more!
Docker is also a tool in which you can use for development operations for optimizing what technologies to include for your product stack. You can easily monitor each container because each container is treated as a process that runs an image. Then you have the power to examine a network that has those containers and better understand how your application is working.
I was planning to do a video, but it's pretty long and boring. I may do the video, but I'm not sure how helpful it will be since there are very good videos out there already! Thank you for checking this article out and have a fantastic day.
Comments powered by CComment