docker
路过君_P
这个作者很懒,什么都没留下…
展开
-
docker容器与宿主机同步时间
只读挂载宿主机localtime文件即可-v /etc/localtime:/etc/localtime:ro原创 2021-01-11 10:28:17 · 453 阅读 · 0 评论 -
docker保存镜像文件
构建镜像# docker build [OPTIONS] PATH | URL | -# 根据当前路径的Dockerfile构建镜像docker build -t imagename:v1 .保存镜像文件# docker save [OPTIONS] IMAGE [IMAGE...]# 将镜像 imagename:v1生成 imagename_v1.tar 文档docker save -o imagename_v1.tar imagename:v1...原创 2021-01-04 15:22:30 · 284 阅读 · 0 评论 -
k8s pod无限重启 报错Back-off restarting failed container
现象K8S POD无限重启报错Back-off restarting failed container原因由于启动容器后,容器内部没有常驻的前台进程,导致容器启动成功后即退出,从而进行了持续的重启。例如ubuntu这类操作系统容器,nginx这种默认后台执行的容器解决操作系统容器增加启动命令配置,例如command: [ "/bin/bash", "-c", "--" ]args: [ "while true; do sleep 30; done;" ]默认后台运行容器改为前台运原创 2020-12-22 08:50:12 · 4908 阅读 · 1 评论 -
K8S 部署nginx 自定义命令参数指定配置文件位置启动失败
YAMLcontainers: - name: nginx-test image: 'nginx:alpine-perl' command: - nginx args: - '-g daemon off;' - '-c /opt/nginx/conf/nginx.conf'现象启动报异常nginx: [emerg] open() “/etc/nginx/ /opt/nginx/conf/nginx.conf” failed (2:原创 2020-12-18 11:42:03 · 1065 阅读 · 0 评论 -
进入docker容器命令行
docker exec -it [containerid] /bin/bash原创 2020-11-27 16:50:45 · 5537 阅读 · 0 评论 -
nginx docker官方镜像使用自定义启动命令启动失败
官方参考资料默认启动命令nginx -g daemon off;If you add a custom CMD in the Dockerfile, be sure to include -g daemon off; in the CMD in order for nginx to stay in the foreground, so that Docker can track the process properly (otherwise your container will stop i原创 2020-11-26 15:08:00 · 334 阅读 · 0 评论 -
windows docker desktop配置国内镜像仓库
右键托盘图标 - 设置修改Docker Engine配置,增加镜像仓库地址{ "registry-mirrors": [ "https://registry.docker-cn.com", "http://hub-mirror.c.163.com", "https://docker.mirrors.ustc.edu.cn" ], "insecure-registries": [], "debug": false, "experimental": fal.原创 2020-11-26 10:36:32 · 9282 阅读 · 1 评论