上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 234 下一页

2020年6月10日

dockerfile——EXPOSE和端口映射参数-p、-P总结

摘要: EXPOSE:功能为暴漏容器运行时的监听端口给外部,但是EXPOSE并不会使容器访问主机的端口,如果想使得容器与主机的端口有映射关系,必须在容器启动的时候加上 -P参数。-P:大写P为自动映射,会将EXPOSE暴露出来的端口随机映射到宿主机的端口上,如果没有暴露端口,就不会有映射。-p:小写p为手动 阅读全文

posted @ 2020-06-10 11:49 ExplorerMan 阅读(3214) 评论(0) 推荐(0)

2020年6月8日

如何控制docker的CPU和内存份额

摘要: 1.内存:docker run -it -m 200M --memory-swap=300M progrium/stress --vm 1 --vm-bytes 500M 刚开始会报错: docker: Error response from daemon: mkdir /var/lib/docke 阅读全文

posted @ 2020-06-08 17:40 ExplorerMan 阅读(1336) 评论(0) 推荐(1)

容器技术之Docker私有镜像仓库harbor

摘要: 前文我们聊到了docker的私有镜像仓库docker-distribution的搭建和简单的使用,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/13058338.html;从前文的搭建和使用过程来看,docker-distribution搭建的仓库非常简陋,它 阅读全文

posted @ 2020-06-08 14:34 ExplorerMan 阅读(462) 评论(0) 推荐(0)

2020年6月4日

Permissions 0644 for ‘/root/.ssh/id_rsa’ are too open处理

摘要: 如果出现 Permissions 0644 for ‘/root/.ssh/id_rsa’ are too open. 等错误显示了,原来只要把权限降到0600就ok了输入命令 chmod 0600 /root/.ssh/id_rsa 1 然后就可以密钥登陆了 sftp -oPort=50022 x 阅读全文

posted @ 2020-06-04 13:08 ExplorerMan 阅读(794) 评论(0) 推荐(0)

2020年6月3日

使用dockerfile克隆私有git仓库

摘要: 我复制了这个代码从似乎是各种工作dockerfiles,这里是我的: FROM ubuntu MAINTAINER Luke Crooks "luke@pumalo.org" # Update aptitude with new repo RUN apt-get update # Install s 阅读全文

posted @ 2020-06-03 21:49 ExplorerMan 阅读(4695) 评论(0) 推荐(0)

docker build 不使用缓存重建镜像

摘要: cache 机制注意事项 可以说,cache 机制很大程度上做到了镜像的复用,降低存储空间的同时,还大大缩短了构建时间。然而,不得不说的是,想要用好 cache 机制,那就必须了解利用 cache 机制时的一些注意事项。1. ADD 命令与 COPY 命令:Dockerfile 没有发生任何改变,但 阅读全文

posted @ 2020-06-03 21:44 ExplorerMan 阅读(16026) 评论(0) 推荐(0)

Dockerfiles ENV和ARG的应用

摘要: 在写Dockerfile时, ENV和ARG,包括.env都是很容易弄混的概念。让我们对其进行区分。 .env文件 和docker-compose.yml配合使用。并不和Dockerfile一起使用 env_file 在Dockerfile中使用,当环境变量很多,可食用该参数,指定对应的变量文件。 阅读全文

posted @ 2020-06-03 19:26 ExplorerMan 阅读(923) 评论(0) 推荐(0)

dockerfile中设置python虚拟环境+gunicorn启动

摘要: FROM python:2.7-slim EXPOSE 8000 COPY ./yourapp /home/yourapp RUN apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y 阅读全文

posted @ 2020-06-03 16:49 ExplorerMan 阅读(813) 评论(0) 推荐(0)

2020年6月2日

Docker容器 暴露多个端口

摘要: 1、创建容器是指定 docker run -p <host_port1>:<container_port1> -p <host_port2>:<container_port2> 2、修改dockerfile expose所需要的端口,这样可以免去-p参数。 阅读全文

posted @ 2020-06-02 14:11 ExplorerMan 阅读(2558) 评论(0) 推荐(0)

2020年6月1日

通过docker history查看镜像构建过程(即dockerfile)

摘要: 介绍: ~]# docker history --help Usage: docker history [OPTIONS] IMAGE Show the history of an image Options: --format string Pretty-print images using a 阅读全文

posted @ 2020-06-01 16:46 ExplorerMan 阅读(1323) 评论(0) 推荐(1)

上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 234 下一页

导航