-
Notifications
You must be signed in to change notification settings - Fork 379
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
Support rootless docker. #890
Conversation
7297d0d
to
c07045f
Compare
7946650
to
169f5a2
Compare
091dd87
to
86e9f83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
one thing I just realised is that we have config::Environment
, we should probably convert all our special case stuff to be in there sometime. This is fine though
Adds support for rootless docker, and manually overriding rootless/rootful container engines through the `CROSS_ROOTLESS_CONTAINER_ENGINE` environment variable. If not set, it will use the default mode for the container engine (rootful for docker, rootless for everything else). ```bash \# use the defaults cross run ... \# auto-select if using rootless (the default) CROSS_ROOTLESS_CONTAINER_ENGINE=auto cross run ... \# always use rootful mode CROSS_ROOTLESS_CONTAINER_ENGINE=0 cross run ... \# always use rootless mode CROSS_ROOTLESS_CONTAINER_ENGINE=1 cross run ... ``` Closes cross-rs#889.
That would also be good, since we could move fn bool_or_default(var: &str) -> bool {
env::var(var)
.map(|s| bool_from_envvar(&s))
.unwrap_or_default()
} And this would cover basically every case. |
bors r=Emilgardis |
Build succeeded: |
…ootless?" (#1380) I recently encountered #1098 and propose an iteration on the fix in #890 This patch adds a last minute check that looks up the current builder endpoint. This may be seen as a costly operation however, as mentioned in #889 Here's the output of `docker builder inspect` on my rootless install: ``` Name: rootless Driver: docker Last Activity: 2023-12-03 02:04:14 +0000 UTC Nodes: Name: rootless Endpoint: rootless # <= THIS HERE Status: running Buildkit: v0.11.7+d3e6c1360f6e Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386 Labels: org.mobyproject.buildkit.worker.moby.host-gateway-ip: 172.17.0.1 ```
Adds support for rootless docker, and manually overriding rootless/rootful container engines through the
CROSS_ROOTLESS_CONTAINER_ENGINE
environment variable. If not set, it will use the default mode for the container engine (rootful for docker, rootless for everything else).Closes #889.