Skip to content

Commit

Permalink
Adding /cargo/bin volume in Podman and README updates
Browse files Browse the repository at this point in the history
- In version 1.6.3 of Podman, support for anonymous volues was added
  which allows for Docker and Podman to both add /cargo/bin for MacOS
  compatibility. The Docker command was reverted to its original version
  and the minimum version of Podman is now set to 1.6.3.
- Minor updates to the README to indicate that Docker and Podman are both
  supported and one of the must be installed.
  • Loading branch information
ostrosco committed Nov 10, 2019
1 parent e141449 commit 6c6da37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ This project is developed and maintained by the [Tools team][team].

- [rustup](https://rustup.rs/)

- A Linux kernel with [binfmt_misc] support is required for cross testing.

[binfmt_misc]: https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html

One of these container engines is required:

- [Docker](https://www.docker.com/). Note that on Linux non-sudo users need to be in the
`docker` group. Read the official [post-installation steps][post].

[post]: https://docs.docker.com/install/linux/linux-postinstall/

- A Linux kernel with [binfmt_misc] support is required for cross testing.

[binfmt_misc]: https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html
- [Podman](https://podman.io). Requires version 1.6.3 or later.

## Installation

Expand Down
12 changes: 3 additions & 9 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,9 @@ pub fn run(target: &Target,
docker
.args(&["-e", &format!("CROSS_RUNNER={}", runner.unwrap_or_else(|| String::new()))])
.args(&["-v", &format!("{}:/xargo:Z", xargo_dir.display())])
.args(&["-v", &format!("{}:/cargo:Z", cargo_dir.display())]);

// Prevent `bin` from being mounted inside the Docker container. This is
// not required for Podman.
if container_engine == DOCKER {
docker.args(&["-v", "/cargo/bin"]);
}

docker
.args(&["-v", &format!("{}:/cargo:Z", cargo_dir.display())])
// Prevent `bin` from being mounted inside the Docker container.
.args(&["-v", "/cargo/bin"])
.args(&["-v", &format!("{}:/project:Z,ro", root.display())])
.args(&["-v", &format!("{}:/rust:Z,ro", sysroot.display())])
.args(&["-v", &format!("{}:/target:Z", target_dir.display())])
Expand Down

0 comments on commit 6c6da37

Please sign in to comment.