原创大约 2 分钟
安装
Jenkins官网列出了Jenkins的多种安装方式,各有利弊,但相对来说MacOS下的安装最为简单和Windows下的安装最为简单。
原创大约 3 分钟
什么是流水线
过去的劳动密集型企业中,流水线
是比手工作坊效率更高的一种生产方式:工人围绕着流水线
,从一个工序到另一个工序,产品被源源不断地生产出来。
在信息技术时代,也经历了从手工作坊到流水线
的进化模式。
流水线
指的并不是工厂中的生产线,也不是哪一台或哪几台具体的机器,而是一个体系。
在早期的互联网大厂中,它的结构就像是下面这样的。
原创大约 4 分钟
准备环境
容器本身有一个健康检查的功能,但是需要在Dockerfile
里定义,或者在执行docker run
的时候,通过下面的一些参数指定。
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ms|s|m|h) (default 0s)
--health-retries int Consecutive failures needed to report unhealthy
--health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
--health-timeout duration Maximum time to allow one check to
原创大约 3 分钟
准备环境
version: "3.8"
services:
box1:
image: busybox
command: /bin/sh -c "while true; do sleep 3600; done"
environment:
- USERNAME=admin
- PASSWORD=${PASSWORD}
box2:
image: busybox
command: /bin/sh -c "while true; do sleep 3600; done"
原创小于 1 分钟
准备环境
version: "3.8"
services:
box1:
image: busybox
command: /bin/sh -c "while true; do sleep 3600; done"
box2:
image: busybox
command: /bin/sh -c "while true; do sleep 3600; done"
原创大约 2 分钟
准备环境
version: "3.8"
services:
box1:
image: busybox
command: /bin/sh -c "while true; do sleep 3600; done"
box2:
image: busybox
command: /bin/sh -c "while true; do sleep 3600; done"
原创大约 1 分钟
基本语法结构。
version: "3.8"
services: # 容器
servicename1: # 容器名,例如redis,这也是内部bridge可以使用的DNS名称
image: # 镜像名
command: # 可选,如果设置,则会覆盖默认镜像里的CMD命令
environment: # 可选,相当于docker run里的 --env
volumes: # 可选,相当于docker run里的 -v
networks: # 可选,相当于docker run里的 --network
ports: # 可选,相当于docker run里的 -p
servicename2:
volumes: # 可选,相当于docker volume create
networks: # 可选,相当于docker network create
原创大约 3 分钟