Category Archives: Docker

Docker and Dev Containers – Understanding the Basics

Over the past few weeks, our in-class activities as well as our last assignment for CS-343 have required running Docker in conjunction with a Dev Container in VSCode. While I was able to follow the instructions given and complete our assignments using these tools, I struggled getting started and navigating through some of the components for in-class activities at times, impeding my ability to work efficiently and keep up with my team. To make things worse, I didn’t have much of an understanding of what each component did and why it’s being used. So, I decided to do some research on these topics, particularly the relevance, benefits and drawbacks of using Dev Containers and how they are connected to VSCode and Docker.

In my search, I found Getting Started With Dev Containers, a blog post by CS professional Dave Storey which clarifies a lot, beginning with addressing why Dev Containers are used. Setting up development environments can be a lengthy and tedious process depending on prerequisites, dependencies or other implementations. Dev Containers utilize the power of containerization – bundling all files, SDKs etc. needed to run an application for several benefits like lower overhead, portability, consistency, and more. 

There are some general advantages and disadvantages of using Dev Containers to be aware of. For starters, they guarantee a consistent development environment regardless of the hardware/operating system being used as long as it can run the container. Similarly, there’s guaranteed consistency across toolsets that each teammate is using, so everyone is familiar and there is no communication or project friction caused by inconsistent setups or toolkits. It’s also quick and easy to integrate a new member to a team/project by instantly setting them up with the same development environment in use by the rest of the team. Dev Containers are reusable and adaptable for other projects, providing long term value by saving time on project set-up.

While there’s lots of advantages, there are also drawbacks that should be considered when strategizing projects and contemplating the use of Dev Containers. There’s an upfront time/cost barrier in setting up the container and its configurations – though available templates make this process easier. To this point, you need to have a basic understanding of Docker and general containerization to set up and maximize benefits from Dev Containers. And, when dependencies and other components become deprecated, maintenance needs to be done to make sure that Dev Containers are up-to-date and usable as they are (usually) not part of main code repositories. 

This helped to clarify things based on what we’ve worked with in class. Dev Containers are using VSCode like an IDE/server which communicates with Git and runs our code in the Docker container. Our implementation in class lets everyone deal with the same tools and environments to leverage these mentioned benefits for group learning projects as well as individual assignments.

Sources:

  1. Getting Started With Dev Containers | by C:\Dave\Storey | Medium
  2. What is a software development kit (SDK)? – Definition from TechTarget

From the blog CS@Worcester – Tech. Worth Talking About by jelbirt and used with permission of the author. All other rights reserved by the author.

Docker

In class, for our activities and homework, the professor told us to download Visual Studio Code and Docker that we were going to use for the semester. I did not know what Docker was and what its purpose was going to be in this class. I was interested in learning more about Docker and why it is such a professional tool in software development.

In software, Docker is an open platform for developing, shipping, and running applications. It enables us to separate our applications from our infrastructure so we can deliver the software quickly. It is a set of platforms as a service product that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-designed.

In a way, Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they’re running on and only requires applications be shipped with things not already running on the host computer.

And importantly, Docker is open source. This means that anyone can contribute to Docker and extend it to meet their own needs if they need additional features that aren’t available out of the box.

I chose this article because I was curious about Docker and wanted to know more about it. So, from all the sources that I could have found, this one has all the details about docker, docker containers, how needed it is in software development, and why it is so desired in companies.

Now that we know what Docker is, let’s understand why it is used and needed for software. Docker streamlines the development lifecycle by allowing developers to work using local standardized environments, using local containers which provide our applications and services.

I think one of the reasons Docker is important, is that it can get more applications running on the same hardware than other technologies, and makes it easier to package and ship programs, which is a high potential. Companies use Docker a lot in software where they do a lot of programming and applications because it makes the work easier and more portable.

As a computer science major, what I understood about Docker even though I have never used it, it’s a great platform when it comes to running applications and can do many of them at the same time. I am still getting used to it with the activities that we do in class and love to see how it works and its roles.

Docker containers, images, and registries | Microsoft Docs

From the blog CS@Worcester – Gracia's Blog (Computer Science Major) by gkitenge and used with permission of the author. All other rights reserved by the author.

Docker Explained.

This week in class we’ve gone over UML Diagrams and the importance of being able to translate back and forth between writing code from the diagram and making a diagram based on the code. The professor told us to download Visual Studio and Docker, which I’m assuming will be used for the entirety of the semester. I didn’t have a single clue as to what Docker was or why it may have been needed. After a brief explanation prof told me to do a little bit of reading myself and so I did. I’m by no means not a Docker expert but the picture has become a bit clearer.

Docker is a container based application that allows you to run services independent of each other. Containers tend to be pretty compact and only carry the information neccesary for a service to work. Docker containers are created through docker images. An image is basically just a template that tells the system how to make the container. An image can consist of many layers, of which each layer is just a previous working version of the image. It’s important to note that an image is read-only. The purpose of the image is to load the container. The top most layer (when the container is created) is what the user works with, whether it’s making changes to the container itself or using the tools that come with the container. When reading about how this technology works the thought of how something like this could be secure kept on swimming through my mind but as each layer of the image is created it becomes a completely new and immutable image. I’m still not entirely sure how this works and will have to spend more time trying to understand, but for now I’ll just take it for what its worth.

Where Docker really becomes a useful tools is in its portablilty and reusabilty. For example, the use of a virtual machine to run certain programs or applications isn’t frowned upon, but it does tend to be costly in terms of using space and memory. A 500MB application could take heaps of memory to run because the guest OS and libraries would need to run before being able to use a desired application. If you wanted to run multiple instances of that application you would need to run multiple VMs. That’s where Docker delivers and gives the user what they need in terms of reusability.

Now Docker containers are not a one stop shop when it comes to solving issues. If a user is trying to use multiple servers and tries to adminstrate them only using Docker containers, they will find themselves in a pinch due to the stripped down capabilties of a container. A container only holds enough information for what actions are necessary to ensure task completion in terms of portabilty. In a scenario like this you would probably want to stick with using a VM to get the full use of the OS and all it’s resources to maintain multiple servers.

Here’s two videos that brought me up to speed on just what type of software Docker is and why it is extremely useful in just over 15 minutes. The explanations are given in a low level manner that allows people like me who couldn’t even begin to understand the concept grasp it better. I hope you enjoy the content, I did!

Containers vs VMs https://www.youtube.com/watch?v=cjXI-yxqGTI
Containerization Explained https://www.youtube.com/watch?v=0qotVMX-J5s

From the blog CS@Worcester – You have reached the upper bound by cloudtech360 and used with permission of the author. All other rights reserved by the author.