Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] dind: include git to support build from remote source #295

Closed
wants to merge 1 commit into from

Conversation

thaJeztah
Copy link
Contributor

This patch installs git in the "dind" variants of the image, to allow using docker build to build from a remote source.

This change adds ~13MB to the image size (after decompressing). Below is a list of image variants ("dind-git" is the local build) for comparison:

REPOSITORY    TAG              IMAGE ID       CREATED          SIZE
docker        20.10-dind-git   35ca9f3f5cbf   10 seconds ago   270MB
docker        20.10-dind       d1a6345c23f3   2 weeks ago      257MB
docker        20.10-git        5675ce6408db   2 weeks ago      253MB
docker        20.10            6e081696197d   2 weeks ago      241MB

And ~6MB compressed (docker save | gzip > file.tgz)

-rw-r--r--  1 sebastiaan  staff    76M Feb 17 17:20 before.tgz
-rw-r--r--  1 sebastiaan  staff    82M Feb 17 17:21 after.tgz

Installing git is done in a separate RUN, so that the layer can be shared between the "20.10-git" and "20.10-dind" variants of the image in situations where both variants are used on the same machine.

This patch installs git in the "dind" variants of the image, to
allow using `docker build` to build from a remote source.

This change adds ~13MB to the image size (after decompressing). Below is a list
of image variants ("dind-git" is the local build) for comparison:

    REPOSITORY    TAG              IMAGE ID       CREATED          SIZE
    docker        20.10-dind-git   35ca9f3f5cbf   10 seconds ago   270MB
    docker        20.10-dind       d1a6345c23f3   2 weeks ago      257MB
    docker        20.10-git        5675ce6408db   2 weeks ago      253MB
    docker        20.10            6e081696197d   2 weeks ago      241MB

And ~6MB compressed (docker save <image> | gzip > file.tgz)

    -rw-r--r--  1 sebastiaan  staff    76M Feb 17 17:20 before.tgz
    -rw-r--r--  1 sebastiaan  staff    82M Feb 17 17:21 after.tgz

Installing git is done in a separate RUN, so that the layer can be
shared between the "20.10-git" and "20.10-dind" variants of the image
in situations where both variants are used on the same machine.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Contributor Author

@tianon @tonistiigi I know this has been discussed before (i.e.; keeping the images "small" where possible); I thought it would be worth discussing again, to provide a better experience for users that use the dind variant for building. The difference in size (for the image pulled) looks to be "limited" (6MB), and of course, there's the non-dind variants that are smaller for users that don't need to run the daemon.

@tianon
Copy link
Member

tianon commented Feb 17, 2021

You mean specifically for buildkit, right? In non-buildkit, the preferred mode is that the client invokes git (which IMO makes a lot more sense).

@thaJeztah
Copy link
Contributor Author

You mean specifically for buildkit, right?

Correct

In non-buildkit, the preferred mode is that the client invokes git

In that case, it could still be useful if the client inside the image is used

which IMO makes a lot more sense

Conveniently removing myself from that discussion, but @tonistiigi probably can provide input on that if needed 😅

@tianon
Copy link
Member

tianon commented Feb 17, 2021

In non-buildkit, the preferred mode is that the client invokes git

In that case, it could still be useful if the client inside the image is used

It could, but that is the use case for the git variant. 😅

@tianon
Copy link
Member

tianon commented Aug 20, 2021

I guess on the size argument, docker-library/golang#250 (comment) is pretty relevant.

(From that point of view, it's pretty tempting to drop the git variants altogether.)

Sign up for free to 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.

2 participants