Skip to content

Commit

Permalink
Initial commit with basic support for remote docker.
Browse files Browse the repository at this point in the history
This supports the volume-based structure, and uses some nice
optimizations to ensure that only the desired toolchain and cargo items
are copied over. It also uses drops to ensure scoped deletion of
resources, to avoid complex logic ensuring their cleanup.

It also supports persistent data volumes, through `cross-util`. In order to setup a persistent data volume, use:

```bash
cross-util create-crate-volume --target arm-unknown-linux-gnueabihf
```

Make sure you provide your `DOCKER_HOST` or correct engine type to ensure these are being made on the remote host. Then, run your command as before:

```bash
CROSS_REMOTE=true cross build --target arm-unknown-linux-gnueabihf
```

Finally, you can clean up the generated volume using:

```bash
cross-util remove-crate-volume --target arm-unknown-linux-gnueabihf
```

A few other utilities are present in `cross-util`:
- `list-volumes`: list all volumes created by cross.
- `remove-volumes`: remove all volumes created by cross.
- `prune-volumes`: prune all volumes unassociated with a container.
- `list-containers`: list all active containers created by cross.
- `remove-containers`: remove all active containers created by cross.

The initial implementation was done by Marc Schreiber, https://github.com/schrieveslaach.

Fixes cross-rs#248.
Fixes cross-rs#273.
Closes cross-rs#449.
  • Loading branch information
Alexhuszagh committed Jun 12, 2022
1 parent 239e8cb commit a2c1a49
Show file tree
Hide file tree
Showing 8 changed files with 1,393 additions and 180 deletions.
58 changes: 58 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ serde_json = "1"
serde_yaml = { version = "0.8", optional = true }
serde_ignored = "0.1.2"
shell-words = "1.1.0"
sha1_smol = "1.0.0"
tempfile = "3.3.0"

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

0 comments on commit a2c1a49

Please sign in to comment.