- 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.
推薦閱讀
- 深入理解Django:框架內幕與實現原理
- Raspberry Pi for Secret Agents(Third Edition)
- Visual Basic程序設計與應用實踐教程
- Kinect for Windows SDK Programming Guide
- Oracle JDeveloper 11gR2 Cookbook
- Expert Data Visualization
- 從零開始學Linux編程
- 微服務從小白到專家:Spring Cloud和Kubernetes實戰
- Creating Mobile Apps with jQuery Mobile(Second Edition)
- Learning YARN
- ASP.NET程序開發范例寶典
- Kotlin開發教程(全2冊)
- Learning Hadoop 2
- 交互設計師成長手冊:從零開始學交互
- Beginning C# 7 Hands-On:The Core Language