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

[build]: add build option to use native docker instead of dind for build #2215

Merged
merged 1 commit into from
Nov 2, 2018

Conversation

ishidawataru
Copy link
Collaborator

@ishidawataru ishidawataru commented Oct 30, 2018

Signed-off-by: Wataru Ishida [email protected]

- What I did

Add a build option to use native dockerd instead of dind for faster build.

related PR : #2016

Also, I found an issue pointing out the slowness of vfs storage driver.
It seems they fixed it by changing the driver to overlay.

Azure/draft#181

- How I did it

mount /var/run/docker.sock in build container

- How to verify it

Add following to rules/config

SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD = y

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

using native docker is faster than dind dockerd with vfs storage driver

sonic-net#2016

Azure/draft#181

Signed-off-by: Wataru Ishida <[email protected]>
@lguohan
Copy link
Collaborator

lguohan commented Oct 31, 2018

How much faster? Do you have data?

@ishidawataru
Copy link
Collaborator Author

I have very rough numbers.

dind: 2h23min, native: 1h45min

I'm not sure I measured with the exact same cache status.
The kernel procure method is download and the build container image is already built for both measurement though.

@lguohan
Copy link
Collaborator

lguohan commented Oct 31, 2018

what is the down side of this option? should this be the build default option?

@ishidawataru
Copy link
Collaborator Author

the dockerd running in the host needs to be executed with --experimental=true

@lguohan
Copy link
Collaborator

lguohan commented Nov 1, 2018

which experimental feature in the docker are you using?

@ishidawataru
Copy link
Collaborator Author

--squash is used in container build procedures, which requires the experimental flag.

@lguohan lguohan merged commit 4db98b4 into sonic-net:master Nov 2, 2018
@ishidawataru ishidawataru deleted the native-dockerd branch November 2, 2018 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants