- Building Web Apps with Spring 5 and Angular
- Ajitesh Shukla
- 299字
- 2021-07-02 19:38:26
What are the key building blocks of Dockers containers?
For setting up our development environment, we will rely on Docker containers, and assemble them together using the tool called Docker compose, which we shall learn about a little later.
Let us understand some of the following, which can also be termed as the key building blocks of Docker containers:
- Docker image: In simple terms, a Docker image can be thought of as a class in Java. Docker containers can be thought of as running instances of the image as like having one or more instances of a Java class. Technically speaking, Docker images consist of a list of layers that are stacked on top of each other to form a base for the containers' root file system. The following diagram represents a command which can be used to create a Docker container using an image named hello-world:

Figure 1.19: Docker command representing creation of Docker container using a Docker image.
In order to set up our development environment, we will require the images of the following to create the respective Docker containers: Tomcat and MySQL
- Dockerfile: A Dockerfile is a text document that contains all the commands which could be called on the command line to assemble or build an image. The docker build command is used to build an image from a Dockerfile and a context. In order to create custom images for Tomcat and MySQL, it may be required to create a Dockerfile, and then build the image. The following is a sample command for building an image using a Dockerfile:
docker build -f tomcat.df -t tomcat_debug .
The preceding command would look for the Dockerfile tomcat.df in the current directory specified by ".", and build the image with the tag tomcat_debug.
推薦閱讀
- The Supervised Learning Workshop
- Python編程自學手冊
- Mastering JavaScript Design Patterns(Second Edition)
- Visual Basic程序設計教程
- LabVIEW虛擬儀器入門與測控應用100例
- Django 3.0入門與實踐
- 進入IT企業必讀的324個Java面試題
- C語言程序設計實踐
- 計算機應用基礎案例教程(第二版)
- 深入大型數據集:并行與分布化Python代碼
- Jakarta EE Cookbook
- Moodle 3.x Developer's Guide
- 面向物聯網的Android應用開發與實踐
- 走近SDN/NFV
- JavaScript重難點實例精講