Skip to content

Run tests using Docker-in-Docker so we can test multiple versions - #1005

Merged
bfirsh merged 2 commits into
docker:masterfrom
aanand:docker-in-docker
Mar 17, 2015
Merged

Run tests using Docker-in-Docker so we can test multiple versions#1005
bfirsh merged 2 commits into
docker:masterfrom
aanand:docker-in-docker

Conversation

@aanand

Copy link
Copy Markdown

This build will fail on Wercker because it depends on docker build -f FILE, which isn't available in Wercker's Docker version (1.2.0).

Next step: get running on Jenkins!

@jessfraz

Copy link
Copy Markdown

👍

@aanand
aanandforce-pushed the docker-in-docker branch 4 times, most recently from 3b2ac69 to d36d611CompareFebruary 24, 2015 19:58
Comment threadscript/test Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a tag to each of these that is the commit sha so docker-compose:$(git rev-parse --short HEAD)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise for parallel builds things are going to get tricky

@jessfraz

Copy link
Copy Markdown

ping @tianon bash god, this going to be tested on jenkins

@jessfraz

Copy link
Copy Markdown

Can we also keep in mind I'm not just going to put "script/test" into Jenkins I'm going to put the docker commands because who is to say someone won't change this into something that we don't want to execute so can we try to keep it concise :)

@jessfraz

Copy link
Copy Markdown

We can also set this up next week when I am in your neck of the woods \o/

@aanand

Copy link
Copy Markdown
Author

OK, I've set it up so that you can kick the whole thing off with a single docker run. This requires two levels of Docker nesting (an outer one where we mount docker.sock, an inner one where we run Docker-in-Docker), but it works.

You should be able to just run:

TAG="docker-compose:$(git rev-parse --short HEAD)"
docker build -t "$TAG".
docker run \
--rm \
--volume="/var/run/docker.sock:/var/run/docker.sock" \
-e "DOCKER_VERSIONS=all" \
-e "TAG=$TAG" \
--entrypoint="script/test-versions" \
"$TAG" \
--verbose

@jessfraz

Copy link
Copy Markdown

You rule!!!!

On Thursday, February 26, 2015, Aanand Prasad notifications@github.com
wrote:

OK, I've set it up so that you can kick the whole thing off with a single docker
run. This requires two levels of Docker nesting (an outer one where we
mount docker.sock, an inner one where we run Docker-in-Docker), but it
works.

You should be able to just run:

TAG="docker-compose:$(git rev-parse --short HEAD)"

docker build -t "$TAG" .

docker run
--rm
--volume="/var/run/docker.sock:/var/run/docker.sock"
-e "DOCKER_VERSIONS=all"
-e "TAG=$TAG"
--entrypoint="script/test-versions"
"$TAG"
--verbose


Reply to this email directly or view it on GitHub
#1005 (comment).

@jessfraz

Copy link
Copy Markdown

Comment threadDockerfile Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be run on the same line as apt-get install otherwise it'll actually make the image bigger. (The debs are still in the layers before then this adds another layer that needs downloading.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also won't actually do anything: https://github.com/docker/docker/blob/738bdec4908755761b27b7d15baeefb1a824f770/contrib/mkimage/debootstrap#L72-L95

The pattern we usually use is RUN apt-get update && apt-get install -y ... && rm -rf /var/lib/apt/lists/*.

@aanand
aanandforce-pushed the docker-in-docker branch 2 times, most recently from 5283db7 to 8d001a1CompareMarch 9, 2015 11:58
@tianon

Copy link
Copy Markdown
Contributor

Looks sane to me 👍

@aanand
aanandforce-pushed the docker-in-docker branch 3 times, most recently from c11fcff to abc1416CompareMarch 9, 2015 17:07
aanand added 2 commits March 9, 2015 17:53
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
@jessfraz

Copy link
Copy Markdown

@dnephin

Copy link
Copy Markdown

Nice! It would be awesome to have this run against multiple python versions as well. Even if it's only python2.6+latest docker, python2.7+latest docker.

At some point we'll want to add python3.4+latest docker

@jessfraz

Copy link
Copy Markdown

merge it merge it merge it

bfirsh added a commit that referenced this pull request Mar 17, 2015
Run tests using Docker-in-Docker so we can test multiple versions
@bfirsh
bfirsh merged commit 1e5b9dc into docker:masterMar 17, 2015
@bfirsh

Copy link
Copy Markdown

Hells yeah

@bfirsh

Copy link
Copy Markdown

ping @jfrazelle

@bfirshbfirsh added this to the 1.2.0 milestone Mar 17, 2015
@bfirsh

Copy link
Copy Markdown

When we get the 1.6 RC, I wonder if we can test against that too...

@jessfraz

Copy link
Copy Markdown

You would just add t to the Dockerfile from the looks of it

@bfirsh

Copy link
Copy Markdown

Oh, yeah. Assumed that'd be in Jenkins. Nice.

@aanand
aanand deleted the docker-in-docker branch March 17, 2015 22:03
@aanand

Copy link
Copy Markdown
Author

Reactivated webhooks, rebased #1088, all looks good.
screen shot 2015-03-17 at 16 32 02

@aanand

Copy link
Copy Markdown
Author

We're not validating the DCO any more - that's very bad. Where's the best place to do that? Presumably not inside a docker run - we don't put .git inside the Docker image.

@aanand

Copy link
Copy Markdown
Author

We could mount the code directory as a volume, and then I can add a script/validate-dco line to the top of script/test-versions. @jfrazelle: sound sensible?

@jessfraz

Copy link
Copy Markdown

ya totally sgtm

On Tue, Mar 17, 2015 at 4:59 PM, Aanand Prasad notifications@github.com
wrote:

We could mount the code directory as a volume, and then I can add a
script/validate-dco line to the top of script/test-versions. @jfrazelle
https://github.com/jfrazelle: sound sensible?


Reply to this email directly or view it on GitHub
#1005 (comment).

@aanand

Copy link
Copy Markdown
Author

@jfrazelle Cool - see #1128.

yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Run tests using Docker-in-Docker so we can test multiple versions
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@aanand@jessfraz@tianon@dnephin@bfirsh