/var/log/seiji

28 Jun 2014

Docker excludes files when sending to its daemon

It seems that this feature is supported. Rebased Dockerignore

Add Dockerfile

1
2
$ cat Dockerfile
FROM centos:6.4

Add ignore files

1
2
3
4
5
6
$ cat .dockerignore
.bundle
.git
log
tmp
vendor

Build image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ time docker build -t centos:noignore .  
Sending build context to Docker daemon 165.4 MB
Sending build context to Docker daemon
Step 0 : FROM centos:6.4
 ---> 539c0211cd76
Successfully built 539c0211cd76
docker build -t centos:noignore .  4.09s user 2.68s system 32% cpu 20.804 total

$ time docker-1.0.1-dev build -t centos:ignore
Sending build context to Docker daemon  1.46 MB
Sending build context to Docker daemon 
Step 0 : FROM centos:6.4
 ---> 539c0211cd76
Successfully built 539c0211cd76
docker-1.0.1-dev build -t centos:ignore .  2.23s user 0.34s system 91% cpu 2.824 total

Appendix

Setting Up a Dev Environment on OSX

1
2
3
4
5
6
7
8
9
10
11
$ git clone https://git@github.com/dotcloud/docker

$ cd docker

$ make build

$ export DOCKER_CLIENTONLY=1 

$ export AUTO_GOPATH=1

$ hack/make.sh dynbinary

Comments

comments powered by Disqus