Skip to content

Use Docker socket via shared emptyDir instead of TCP/mTLS - #2324

Merged
mumoshu merged 6 commits into
actions:masterfrom
milas:docker-socket
Mar 28, 2023
Merged

mumoshu merged 6 commits into
actions:masterfrom
milas:docker-socket

Conversation

@milas

@milas milas commented Feb 25, 2023

Copy link
Copy Markdown
Contributor

By default, the docker:dind entrypoint will auto-generate mTLS certs and run with TCP on 0.0.0.0. This is handy for accessing the running Docker Engine remotely by then publishing the ports. For the runner, we don't need (or want) that behavior, so a Unix socket lets us rely on filesystem permissions.

This also has the benefit of eliminating the need for mTLS, which will speed up Pod start slightly (no need to generate CA & client certs), and will fix #893 and generally improve compatibility with apps that interact with the Docker API without requiring a custom Docker context to be initialized.

@milas

milas commented Feb 25, 2023

Copy link
Copy Markdown
Contributor Author

I'm successfully running jobs using this without needing explicit Docker context setup.

Sample: https://github.com/milas/rock5-toolchain/actions/runs/4270921744/jobs/7435031799

@Link- Link- added needs triage Requires review from the maintainers community Community contribution labels Mar 21, 2023
@mumoshu
mumoshu force-pushed the docker-socket branch 4 times, most recently from 585d67f to 38b4b08 Compare March 26, 2023 01:08
@mumoshu

mumoshu commented Mar 26, 2023

Copy link
Copy Markdown
Collaborator

@milas Hey! Sorry for the radio silence. Testing this locally and fixing failing unit tests took a bit more time than I expected.

I think this is now ready to be merged, and I'll merge this in a day or two.
After that, our automated runner image release process would get triggered, and the latest tag will contain this change.

milas and others added 6 commits March 28, 2023 11:18
By default, the `docker:dind` entrypoint will auto-generate mTLS certs
and run with TCP on `0.0.0.0`. This is handy for accessing the running
Docker Engine remotely by then publishing the ports. For the runner,
we don't need (or want) that behavior, so a Unix socket lets us rely
on filesystem permissions.

This also has the benefit of eliminating the need for mTLS, which will
speed up Pod start slightly (no need to generate CA & client certs),
and will fix actions#893 and generally improve compatibility with apps that
interact with the Docker API without requiring a custom Docker context
to be initialized.
@mumoshu
mumoshu merged commit 878c9b8 into actions:master Mar 28, 2023
@mumoshu

mumoshu commented Mar 28, 2023

Copy link
Copy Markdown
Collaborator

Merged. Thank you so much for your contribution, @milas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Community contribution needs triage Requires review from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot Creating a new builder instance in [Set up Docker Buildx]

3 participants