2

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?enter image description here

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Good feedback, which echoes what I already mentioned in my answer. +1
With the above workaround in my 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?"
@JørnSchou-Rode I got the same error, here is what Circle told me to do, and I tested it and it works: Could you please add sudo before the curl command? This will make sure that the newer Docker version is installed (in the build you link to the last installation step fails). Also, you’ll need to start the Docker daemon after installing Docker, so please add sudo service docker start after you install the newer Docker version.
2

docker build -f is a feature from Docker 1.5 (See PR 9707)

CircleCI has not yet integrated docker 1.5.

See the FAQ:

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.