Skip to content

Commit ed7c67a

Browse files
Merge #771
771: Fix parsing of docker options. r=Emilgardis a=Alexhuszagh Fix parsing `DOCKER_OPTS` to correctly parse them as shell words, rather than splitting on whitespace. Closes #769. Co-authored-by: Alex Huszagh <[email protected]>
2 parents ee2fc1b + d5b807e commit ed7c67a

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3737

3838
### Fixed
3939

40+
- #771 - fix parsing of `DOCKER_OPTS`.
4041
- #727 - add `PKG_CONFIG_PATH` to all `*-linux-gnu` images.
4142
- #722 - boolean environment variables are evaluated as truthy or falsey.
4243
- #720 - add android runner to preload `libc++_shared.so`.

Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ serde = { version = "1", features = ["derive"] }
2727
serde_json = "1"
2828
serde_yaml = { version = "0.8", optional = true }
2929
serde_ignored = "0.1.2"
30+
shell-words = "1.1.0"
3031

3132
[target.'cfg(not(windows))'.dependencies]
3233
nix = { version = "0.24", default-features = false, features = ["user"] }

src/docker.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ pub fn run(
312312
}
313313

314314
if let Ok(value) = env::var("DOCKER_OPTS") {
315-
let opts: Vec<&str> = value.split(' ').collect();
315+
let opts = shell_words::split(&value)
316+
.wrap_err_with(|| format!("could not parse docker opts of {}", value))?;
316317
docker.args(&opts);
317318
}
318319

0 commit comments

Comments
 (0)