- 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.
推薦閱讀
- Advanced Machine Learning with Python
- Mastering ServiceStack
- 信息可視化的藝術(shù):信息可視化在英國
- 深入淺出Java虛擬機(jī):JVM原理與實(shí)戰(zhàn)
- Python語言程序設(shè)計(jì)
- Designing Hyper-V Solutions
- Python金融數(shù)據(jù)分析
- Scratch 3.0少兒編程與邏輯思維訓(xùn)練
- Mastering Ubuntu Server
- 全棧自動(dòng)化測試實(shí)戰(zhàn):基于TestNG、HttpClient、Selenium和Appium
- 大數(shù)據(jù)分析與應(yīng)用實(shí)戰(zhàn):統(tǒng)計(jì)機(jī)器學(xué)習(xí)之?dāng)?shù)據(jù)導(dǎo)向編程
- Python Data Science Cookbook
- 編程可以很簡單
- C++編程兵書
- 零基礎(chǔ)學(xué)HTML+CSS