当使用Dockerfile Build镜像时,优势会发现发送到Daemo的内容过大
build image:q_build/javaweb:20150910174642
Sending build context to Docker daemon 4.768 GB
Sending build context to Docker daemon
Step 0 : FROM 192.168.100.123:5000/q_basic/javaweb:1.0
---> 0aab72ab2945
Step 1 : MAINTAINER tyleryan <156926528@qq.com>
---> Running in 177026c30954
---> 3cc2be8f728d
Removing intermediate container 177026c30954
Step 2 : ADD monitor.war /usr/local/tomcat/webapps/
---> b8b56342b691
Removing intermediate container c0108ff358f3
Step 3 : EXPOSE 8080
---> Running in 451fa4de3e21
---> 13f7293f7ffe
Removing intermediate container 451fa4de3e21
Successfully built 13f7293f7ffe
delete locally build docker images:q_build/javaweb:20150910174642
但是我们的Dokerfile 非常简单,那么这些多出来的内容是从哪里来的呢。
查阅资料后,
发现Docker Client会默认发送Dockerfile同级目录下的所有文件到Dockerdaemon中。
解决办法有两种:
1.使用.dockerignore文件,设置黑名单,该文件包含的目录不会被发送到Docker daemon中
2.将Dockerfile迁移后其他目录中执行。
相关推荐
您知道什么时候说Sending build context to Docker daemon吗? 该程序显示了构建Docker上下文时所花费的时间和字节数。 它直接基于Docker本身用于构建上下文的相同逻辑。 入门(码头工人): docker build -t ...
Sending build context to Docker daemon 3.584 kB Sending build context to Docker daemon Step 0 : FROM ddollar/heroku-bamboo ---> 66f87f3cd8fb ... Step 32 : CMD thin -p ...
[[NORMAL]]+ docker build --no-cache -t build-args-normal .Sending build context to Docker daemon 56.32 kBStep 1 : FROM debian ---> bf84c1d84a8fStep 2 : ARG user="nginx" ---> Running in ...
fabric编译环境部署文档依赖文件 Successfully tagged hyperledger/fabric-orderer:latest docker tag hyperledger/fabric-orderer hyperledger/fabric-orderer:...Sending build context to Docker daemon 9.428MB
Sending build context to Docker daemon 98.82 kB Sending build context to Docker daemon Step 0 : FROM ruby:2.2.2-onbuild # Executing 4 build triggers Trigger 0, COPY Gemfile /usr/sr
Sending build context to Docker daemon 153.6 kB Sending build context to Docker daemon Step 0 : FROM centos:centos7 ---> 7322fbe74aa5 Step 1 : RUN yum install -y ...
Sending build context to Docker daemon 7.68 kB Sending build context to Docker daemon ... Successfully built e2666914b094 从那里,您可以使用start目标启动服务器: $ make start-api b1d7b15d68632883ba...
使用Docker和Nginx的静态站点 ...Sending build context to Docker daemon 81.41 kB Step 1/3 : FROM nginx:alpine --- > 2f3c6710d8f2 Step 2/3 : COPY default.conf /etc/nginx/conf.d/default.
Sending build context to Docker daemon 7.68 kB Step 0 : FROM alpine:3.2 ---> ab7e84202862 Step 1 : RUN apk add --update nginx && rm -rf /var/cache/apk/* ---> Using cache ---> 4ffb8220a47f ...
Sending build context to Docker daemon 27.23 MBSending build context to Docker daemonStep 0 : FROM centos:6.6 ---> 8b44529354f3Step 1 : ADD 2.1.3/etcd /bin/etcd ---> 4a07d17fbfadRemoving ...
笔记 OAM Server的SWF方法无法解决,因此未使用此代码。 虽然这里有一些很棒的东西,所以请随时...Sending build context to Docker daemon 7.68 kB Sending build context to Docker daemon ... Successfully built
Splunk 将其放入您的 Splunk“inputs.conf”(或通过 Web UI 添加新的 TCP 输入): [tcp://1234]sourcetype = my_source_type构建 logspout-splunk 容器运行./build.sh : Sending build context to Docker daemon....
Sending build context to Docker daemon 34.82kB Step 1/10 : FROM golang:1.16-alpine AS builder ---> fe5c000a4768 // ... Step 10/10 : COPY --from=builder ${dir}/${bin} /${bin} ---> Using cache ...
~/src/kfuzz$ make docker#-----------------------------------#- setup docker#-----------------------------------docker build -t kernel .Sending build context to Docker daemon 79.87 kB[... blablabla ......