Summary

In this post, we covered an introduction to docker containers and explained the concept of containerization through concepts illustration and a practical example. we also covered an configuring, building and running docker containers and explained the concept of running multiple docker containers together through docker-compose.

This post covers the answers for Intro to Docker and Intro to Containerisation room in TryHackMe.

What is Containerization

In computing terms, containerization is the process of packaging an application and the necessary resources (such as libraries and packages) required into one package named a container. The process of packaging applications together makes applications considerably portable and hassle-free to run.

Modern applications are often complex and usually depend on frameworks and libraries being installed on a device before the application can run. These dependencies can:

  • Be difficult to install depending on the environment the application is running (some operating systems might not even support them!)
  • Create difficulty for developers to diagnose and replicate faults, as it could be a problem with the application’s environment – not the application itself!
  • Can often conflict with each other. For example, having multiple versions of Python to run different applications is a headache for the user, and an application may work with one version of Python and not another.

Get OSCP Certificate Notes

What are Docker Containers?

Docker is a relatively hassle-free, extensive and open source containerisation platform. The Docker ecosystem allows applications (images – we’ll come onto this in a later room) to be deployed, managed and shared with ease.

Working on Linux, Windows and MacOS, Docker is a smart choice for running applications. Applications can be published as “images” and shared with others. All that is required is pulling (downloading) the image and running it with Docker.

Docker employs the same technology used in containerisation to isolate applications into containers called the Docker Engine. The Docker Engine is essentially an API that runs on the host operating system, which communicates between the operating system and containers to access the system’s hardware (such as CPU, RAM, networking and disk)

Because of this, the Docker engine is extensive and allows you to do things like:

  1. Connect containers together (for example, a container running a web application and another container running a database)
  2. Export and import applications (images)
  3. Transfer files between the operating system and container

Docker uses the programming syntax YAML to allow developers to instruct how a container should be built and what is run. This is a significant reason why Docker is so portable and easy to debug; share the instructions, and it will build and run the same on any device that supports the Docker Engine.

Challenges Answers

What is the name of the kernel feature that allows for processes to use resources of the Operating System without being able to interact with other processes?
In a normal configuration, can other containers interact with each other? (yay/nay)
What does an application become when it is published using Docker? Format: An xxxxx (fill in the x’s)

What is the abbreviation of the programming syntax language that Docker uses?

In what year was Docker originally created?

Where was Docker first showcased?

What version of Unix had the first concepts of containerisation?

What command can we use to view a list of running processes?
Containerise the applications in the static site. What is the flag?
If we wanted to pull a docker image, what would our command look like?

If we wanted to list all images on a device running Docker, what would our command look like?

Let’s say we wanted to pull the image “tryhackme” (no quotations); what would our command look like?

Let’s say we wanted to pull the image “tryhackme” with the tag “1337” (no quotations). What would our command look like?

What would our command look like if we wanted to run a container interactively?

Note: Assume we are not specifying any image here.

What would our command look like if we wanted to run a container in “detached” mode?

Note: Assume we are not specifying any image here.

Let’s say we want to run a container that will run and bind a webserver on port 80. What would our command look like?

Note: Assume we are not specifying any image here.

How would we list all running containers?

Now, how would we list all containers (including stopped)?

What instruction would we use to specify what base image the container should be using?
What instruction would we use to tell the container to run a command?

What docker command would we use to build an image using a Dockerfile?

Let’s say we want to name this image; what argument would we use?

I want to use docker-compose  to start up a series of containers. What argument allows me to do this?

I want to use docker-compose  to delete the series of containers. What argument allows me to do this?

What is the name of the .yml file that docker-compose uses?

Note: for this question, you will need to include the .yml file extension in your answer

What does the term “IPC” stand for?
What technology can the Docker Server be equalled to?
Connect to the machine. What is the name of the container that is currently running?

Use Docker to start a web server with the “webserver” image (no quotations). You will need to run the container with port 80.

After starting the container, try to connect to https://LAB_WEB_URL.p.thmlabs.com/ in your browser. What is the flag?

Video Walk-through

About the Author

Mastermind Study Notes is a group of talented authors and writers who are experienced and well-versed across different fields. The group is led by, Motasem Hamdan, who is a Cybersecurity content creator and YouTuber.

View Articles