Skip to main content

Command Palette

Search for a command to run...

What Are Containers, and Why Do They Matter?

Updated
4 min read
H

Hack United is an organization that empowers hackers and builders! Join us on hackathons in your free time!

After hours of brainstorming, you finally come up with the perfect idea for your next Computer Science Project. You run to your room and spend days, maybe weeks, making your idea come to life. After finishing the game, you send it to your friends, obviously, and expect countless “Wows”, “Woahs”, and “Great Job Bro!”. Instead, your messages get populated with “Bro this doesn’t work on my phone!”, “dude learn cs before sending games” and “what even is this?” You’re now sitting at your desk hunched over, wondering what went wrong. This issue of a program not working on other people’s machines is actually very common, but you didn’t know that.

A common misconception in tech is that a program will work on every machine, but this is usually not the case. Just because something works on your computer doesn't mean it will work everywhere. This is where containers come into play.

What Is a Container?

Well, first of all, what even is a container? A container is like a lunchbox; it has everything you need for lunchtime. Your food, your snacks, maybe a juicebox, all put into your lunchbox, your container. Whether you’re at home or at a friend’s house, everything you packed is always there, right where and how you expect it.

A container in the tech world does the same thing! It packs a project and all its dependencies, including React Components, Pictures, Libraries, Tools, Settings, etc., into a single unit - a single lunchbox, a single container. This means the app can run anywhere! Whether it’s a project running on a personal computer or on a teacher’s computer, it will run the same universally after being downloaded.

What Is Docker?

We talked about Containers but what is Docker? Docker is also one of the most popular tools that work with containers! Docker is similar to a kitchen which makes the lunchbox. The kitchen has all the resources to make your lunch. It has the ingredients to make your main items and has all the snacks and extra you want.

Docker in the tech world can be viewed as something that

  • Builds containers using simple files,

  • Runs those containers anywhere,

  • And Shares containers with others (like sending a lunchbox recipe)

It’s fast and super helpful in web development.

Dockers are very fast, can be used over and over again, and very important in web development. One could say that Dockers and Containers are two sides of the same coin.

How Are Containers Used in Web Development?

Let’s make a project that involves web development. Your project may include a database to store data, a server to handle requests, and maybe some backend code for functionality in python or Node.js. Each part could easily be put in separate containers to help with the programming and views when looking at the project on different machines. Putting each element in separate containers also allows

  • Developers to work on different parts of the project without breaking anything,

  • Test locally before deploying with ease,

  • And have the confidence of knowing that your site will launch anywhere and its functionality will be unchanged from machine to machine.

A real world example of this is with Instagram. Instagram runs tons of containers behind the scenes to make sure everything works. It runs photo uploads, stories, comments, etc. and each of these is a small part that can be built and run separately using containers.

How Can Someone Use Docker Today?

If you’re curious and want to try Docker:

  1. Install Docker Desktop: It's free and works on Windows, macOS, and Linux.

  2. Try a tutorial: Docker has great beginner guides. You can even run a mini web server on your computer in just a few steps!

  3. Explore DockerHub: It’s like an app store for containers. You can download pre-made containers (like a Python environment or a database) and run them instantly.

Why Containers Are a Big Deal

Containers make apps more reliable, faster to set up, and easier to share. They’re used by every big tech company such as Google, Netflix, Spotify, and many more to ensure their apps work everywhere, every time.

Conclusion

Even if you're not coding full-time yet, understanding containers is like knowing how to pack a really smart lunch. It helps you think about how tech can be organized, moved, and reused. As you explore web development or app building, containers (and Docker) will be powerful tools to know.

And the best part? You don’t need to be an expert to start using them. So the next time you’re making a project, protect your honor from a plethora of “Bro your app sucks”, and instead fill your messages with tons of “WOW, this is amazing!”s