This shows you the differences between two versions of the page.
ii:labs:s2:04 [2024/04/11 12:42] radu.ciobanu |
ii:labs:s2:04 [2025/04/13 18:19] (current) florin.stancu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Lab 04 - Docker ====== | + | ====== Lab 05 - Docker ====== |
===== Objectives ===== | ===== Objectives ===== | ||
Line 87: | Line 87: | ||
Because Docker did not initially have native support for Windows and MacOS, [[https://docs.docker.com/toolbox/overview/|Docker Toolbox]] was introduced, which can launch a virtualised Docker environment (more specifically, it uses a VirtualBox machine as the basis of the Docker environment). Recently, Docker Toolbox was marked as "legacy" and was replaced by [[https://docs.docker.com/docker-for-mac/|Docker Desktop for Mac]] and [[https://docs.docker.com/docker-for-windows/|Docker Desktop for Windows]], which offer similar features with better performance. Furthermore, Windows Server 2016 and Windows 10 now support native Docker for the **//x86_64//** architecture. | Because Docker did not initially have native support for Windows and MacOS, [[https://docs.docker.com/toolbox/overview/|Docker Toolbox]] was introduced, which can launch a virtualised Docker environment (more specifically, it uses a VirtualBox machine as the basis of the Docker environment). Recently, Docker Toolbox was marked as "legacy" and was replaced by [[https://docs.docker.com/docker-for-mac/|Docker Desktop for Mac]] and [[https://docs.docker.com/docker-for-windows/|Docker Desktop for Windows]], which offer similar features with better performance. Furthermore, Windows Server 2016 and Windows 10 now support native Docker for the **//x86_64//** architecture. | ||
+ | |||
+ | <note tip> | ||
+ | If you do not want to install Docker on your machine, you can use the [[https://labs.play-with-docker.com|Play with Docker]] virtual environment. | ||
+ | </note> | ||
===== Testing the installation ===== | ===== Testing the installation ===== | ||
Line 224: | Line 228: | ||
===== Creating an image ===== | ===== Creating an image ===== | ||
- | So far, we only ran containers based on existing images, but now we will see how we can create and publish our own application. During the Docker labs, we will go through an entire cloud application hierarchy. For this particular lab, we will start from the bottom level of this hierarchy, which is represented by the **//containers//**. Above this level, there are the **//services//**, which define how the containers behave in production, and at the highest level there is the **//service stack//**, which defines the interactions between services. The sources for this example can be found in the **//flask_app//** folder of the {{:ii:labs:s2:03:tasks:lab3.zip|lab archive}}. | + | So far, we only ran containers based on existing images, but now we will see how we can create and publish our own application. During the Docker labs, we will go through an entire cloud application hierarchy. For this particular lab, we will start from the bottom level of this hierarchy, which is represented by the **//containers//**. Above this level, there are the **//services//**, which define how the containers behave in production, and at the highest level there is the **//service stack//**, which defines the interactions between services. The sources for this example can be found in the **//flask_app//** folder of the {{:ii:labs:s2:04:lab4_docker.zip|lab archive}}. |
In this example, we will create a web application using Flask (as studied in [[https://ocw.cs.pub.ro/courses/ii/labs/s2/02|lab 2]] and [[https://ocw.cs.pub.ro/courses/ii/labs/s2/02|lab 3]]), which displays a random picture each time its main page is accessed. The application's code can be found in a file called **//app.py//**, which looks like this: | In this example, we will create a web application using Flask (as studied in [[https://ocw.cs.pub.ro/courses/ii/labs/s2/02|lab 2]] and [[https://ocw.cs.pub.ro/courses/ii/labs/s2/02|lab 3]]), which displays a random picture each time its main page is accessed. The application's code can be found in a file called **//app.py//**, which looks like this: |