分类目录归档:未分类

Docker容器修改

修改容器中的文件

方法一:进入容器进行编辑: docker exec -it 容器名 /bash路径

方法二:修改文件

cp 容器:/容器文件路径 宿主机路径
用自己熟悉的编辑器编辑
cp 宿主机路径 容器:/容器文件路径

cp 容器:/容器文件路径 宿主机路径

容器运行环境的修改

docker update 命令

Usage: docker container update [OPTIONS] CONTAINER [CONTAINER…]

Update configuration of one or more containers

Options:
–blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to
disable (default 0)
–cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
–cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
–cpu-rt-period int Limit the CPU real-time period in microseconds
–cpu-rt-runtime int Limit the CPU real-time runtime in microseconds
-c, –cpu-shares int CPU shares (relative weight)
–cpus decimal Number of CPUs
–cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
–cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
–kernel-memory bytes Kernel memory limit
-m, –memory bytes Memory limit
–memory-reservation bytes Memory soft limit
–memory-swap bytes Swap limit equal to memory plus swap: ‘-1’ to enable
unlimited swap
–pids-limit int Tune container pids limit (set -1 for unlimited)
–restart string Restart policy to apply when a container exits

正则表达式中?=和?:和?!的理解

// 前瞻:
exp1(?=exp2) 查找exp2前面的exp1
// 后顾:
(?<=exp2)exp1 查找exp2后面的exp1
// 负前瞻:
exp1(?!exp2) 查找后面不是exp2的exp1
// 负后顾:
(?<!exp2)exp1 查找前面不是exp2的exp1

()表示捕获分组,()会把每个分组里的匹配的值保存起来,使用$n(n是一个数字,表示第n个捕获组的内容),或者用(<groupname>)来给分组取个名字。
(?:)表示非捕获分组,和捕获分组唯一的区别在于,非捕获分组匹配的值不会保存起来