官术网_书友最值得收藏!

Immutable infrastructure with containers

Containerization consists of deploying applications in containers instead of deploying them in VMs.

Today, it is very clear that the container technology to be used is Docker and that the configuration of a Docker image is also done in code in a Dockerfile. This file contains the declaration of the base image, which represents the bone to be used, the installation of additional middleware to be installed on the image, only the files and binaries necessary for the application, and the network configuration of the ports. Unlike VMs, containers are said to be immutable; the configuration of a container cannot be modified during its execution.

Here is a simple example of a Dockerfile:

FROM ubuntu
RUN apt-get update
RUN apt-get install -y nginx
ENTRYPOINT ["/usr/sbin/nginx","-g","daemon off;"]
EXPOSE 80

In this Docker image, we use a basic Ubuntu image, install nginx, and expose port 80.

The Docker part will be discussed in detail in Chapter 7, Containerizing Your Application with Docker.
主站蜘蛛池模板: 邵东县| 德钦县| 洱源县| 玉门市| 上高县| 宣威市| 右玉县| 聊城市| 罗平县| 玉门市| 墨竹工卡县| 台东市| 凌海市| 伊川县| 林口县| 建宁县| 扶沟县| 墨江| 灌云县| 平潭县| 胶州市| 延津县| 敖汉旗| 科技| 德令哈市| 南和县| 临西县| 秦安县| 邵东县| 博爱县| 曲麻莱县| 隆安县| 连城县| 兴国县| 土默特右旗| 上虞市| 调兵山市| 尚义县| 北流市| 友谊县| 密云县|