See the enclosed image. On my CoreOS box, Docker bulid has a flag -f (file) which allows you to specify a dockerfile not named "Dockerfile" to create the build. When I try to call "Docker -f Dockerfile-dev", for example, on CircleCI, it fails with "flag provided but not defined: -f". In the enclosed image, you can see that the -f flag is unknown to the Docker instance on CircleCI. Is there any way around this, or is "Dockerfile" the required name for dockerfiles used for CircleCI builds?
2 Answers
Here is the answer I got from CircleCI:
We already have builds of Docker 1.5 and 1.6 that can be run on CircleCI, but they’re not yet in our containers. Right now you can start using Docker 1.5 or 1.6 if you add this to your circle.yml, for example in the dependencies: pre section:
curl -L -o /usr/bin/docker 'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.5.0-circleci'; chmod 0755 /usr/bin/docker; true
or
curl -L -o /usr/bin/docker 'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.6.0-circleci'; chmod 0755 /usr/bin/docker; true
You'll want to remove docker from the services section if you do this as you're starting docker manually now.
We will be adding 1.5 and 1.6 to our build containers by default very soon, so this hack should become unnecessary in the next few weeks.
3 Comments
dependencies.override step, I get this error on the subsequent docker run command: "FATA[0000] Post http:///var/run/docker.sock/v1.16/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?"docker build -f is a feature from Docker 1.5 (See PR 9707)
CircleCI has not yet integrated docker 1.5.
Running Docker 1.5 in our environment requires custom patches, and we need to test the patched version thoroughly before making it available in our containers.
Keep an eye on our changelog to be notified as soon as Docker 1.5 starts shipping with our build containers by default.
June 2015: even though the changelog doesn't yet mention in, Docker 1.6 might be supported now, meaning docker build -f is supported.