Carry #27834 — Do not require .git in the build context#30290
Carry #27834 — Do not require .git in the build context#30290thaJeztah merged 4 commits intomoby:masterfrom
.git in the build context#30290Conversation
|
Had to re-open because I force-pushed the branch before re-opening the PR... 😅 |
|
@vdemeester - Think I've got all the remaining bits for Windows done. Can you cherry-pick microsoft@e969eab from https://github.com/Microsoft/docker/tree/jjh/gitignore? I am just doing the final validations to the CI script itself so that it works in the current mode (with .git present in the docker image) and this new mode (without .git in the docker image). Once I've done that, I'll update production Jenkins and things should be good :) |
b9cbca4 to
9193c90
Compare
Signed-off-by: John Howard <jhoward@microsoft.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
- export DOCKER_GITCOMMIT in the Makefile - prioritize DOCKER_GITCOMMIT against the `git` command in `./hack/make.sh` - Also add `integration-cli/bundles` to gitignore (it's generated when using integration-cli shell) Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: John Howard jhoward@microsoft.com Signed-off-by: Vincent Demeester <vincent@sbr.pm>
9193c90 to
f32b267
Compare
|
Updated.. Something bad though, is that some of the validate scripts (lots) are using |
|
Bind mount |
|
Ok so it's green, I did 2 things:
|
thaJeztah
left a comment
There was a problem hiding this comment.
tested this, and looks to all work, so LGM
but, would like to have @tianon @andrewhsu @cpuguy83 @tiborvass double check if there's possible issues with bind-mounting
.dockerignore
Outdated
There was a problem hiding this comment.
Ah you are right 👼 I'll update 😉
348857c to
8e6d8eb
Compare
Makefile
Outdated
There was a problem hiding this comment.
This line could be written more concisely by taking the second -v part completely out of the $(if...), ie:
DOCKER_MOUNT := $(if $(DOCKER_MOUNT),$(DOCKER_MOUNT),-v /go/src/github.com/docker/docker/bundles) -v $(CURDIR)/.git:/go/src/github.com/docker/docker/.gitI'm definitely concerned about what this might mean for remote daemons (since DOCKER_MOUNT already takes DOCKER_HOST into account), but I'm not sure that there's a good solution for that. Perhaps it'd be fine if those validate scripts simply are not supported with a remote daemon unless one explictly removes .git from the .dockerignore?
There was a problem hiding this comment.
ah right. Yeah we might print a warning if validate is called on a remote daemon, wdyt ?
hack/make.sh
Outdated
There was a problem hiding this comment.
This line already exists above (line 72) -- any reason it needs to be repeated here? (we need BUILDTIME set regardless, so I think the one up on line 72 is correct)
There was a problem hiding this comment.
Hum, I don't think there is a reason for that, I'll remove 👼
|
SGTM 👍
|
|
ping @cpuguy83 |
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
8e6d8eb to
617be0e
Compare
cpuguy83
left a comment
There was a problem hiding this comment.
LGTM
This actually works out well because now I can build with separate worktrees (git worktree add ../other-docker my_branch)
|
I'll go ahead and merge this, looks like we have enough LGTM's 🏎 🐎 |
Carry #27834 and hopefully fixes builds 👼.
.gitto.dockerignoregitcommand in./hack/make.shintegration-cli/bundlesto gitignore (it's generated whenusing integration-cli shell)
Note that, on my laptop for example, I'm sending
30Mof context with this, and150Mwithout 🙀, so I really think this can be a huge win 👼/cc @tianon @jhowardmsft @icecrime @thaJeztah @cpuguy83
🐸