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

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.
主站蜘蛛池模板: 绵阳市| 泸西县| 青州市| 襄城县| 拜泉县| 敦煌市| 荔浦县| 枣阳市| 通州市| 平安县| 桃源县| 黄浦区| 天祝| 淮阳县| 嘉义县| 上犹县| 元江| 金湖县| 中宁县| 孙吴县| 宁远县| 陇川县| 四平市| 石屏县| 色达县| 武功县| 金川县| 奎屯市| 无锡市| 化德县| 遂昌县| 任丘市| 阜平县| 宝坻区| 清水河县| 佳木斯市| 大石桥市| 平塘县| 巴彦县| 于田县| 双牌县|