CMD centos7 安装 最新版本的docker ENTRYPOINT - 导入镜像 save tar mariadb Dockerfile 构建镜像
cd /wxqyh/soft/micro tar -xvf docker-19.03.8.tgz cp docker/* /usr/bin/ ---------------------------- echo '[Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity # Uncomment TasksMax if your systemd version supports it. # Only systemd 226 and above support this version. # TasksMax=infinity TimeoutStartSec=0 # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes # kill only the docker process, not all processes in the cgroup KillMode=process # restart the docker process if it exits prematurely Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target' > /etc/systemd/system/docker.service --------------------------------- mkdir -p /etc/docker echo '{ "registry-mirrors": ["https://72idtxd8.mirror.aliyuncs.com"], "log-driver":"json-file", "log-opts": {"max-size":"1024m", "max-file":"3"} }' > /etc/docker/daemon.json --------------------------------- chmod +x /etc/systemd/system/docker.service systemctl daemon-reload systemctl start docker systemctl enable docker.service
sudo systemctl daemon-reload
sudo systemctl restart docker
https://dev.aliyun.com/list.html 寻找镜像
Dockerfile 原语里面ENTRYPOINT 是docker的启动进程,CMD是ENTRYPOINT的参数
#########################################################################
mariadb Dockerfile
在mysql官方镜像中提供了容器启动时自动执行/docker-entrypoint-initdb.d文件夹下的脚本的功能(包括shell脚本和sql脚本)
也就是说只要把你自己的初始化脚本放到/docker-entrypoint-initdb.d/文件夹下就齐活了。
参考:https://blog.csdn.net/10km/article/details/79046864
概念:--link selenium_hub:hub
hub是该容器在link下的别名(alias),通俗易懂的讲,站在node容器的角度,selenium_hub和hub都是1cbbf6f07804容器的名字,并且作为容器的hostname,node用这2个名字中的哪一个
/docker-entrypoint-initdb.d
/docker-entrypoint-initdb.d/
ENTRTYPOINT CMD两者的联系和区别 # the command of entrypoint ENTRYPOINT ["nginx"] CMD ["-g","daemon off;"] CMD ["/bin/bash"] == docker run -it images /bin/bash CMD带的参数会变成ENTRYPOINT的参数
3.save - load images 镜像
mkdir /opt/images; cd /opt/images docker images > /tmp/images.txt ; awk '{print "docker save -o "$1"_"$2".tar "$1":"$2}' /tmp/images.txt
用一个例子来演示会更加清晰
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App