cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.49k stars 365 forks source link

Can't use `dockerfile` to custom env when there's no default image provided by cross #1355

Closed Dirreke closed 10 months ago

Dirreke commented 10 months ago

Describe your issue

I use cross to build for Tier3 target csky-unknown-linux-gnuabiv2hf and I write a Dockerfile. I add the following to Cross.toml

[target.csky-unknown-linux-gnuabiv2hf]
dockerfile = "./path/to/docker/dockerfile"

However, when I run cross, it sait that

`cross` does not provide a Docker image for target csky-unknown-linux-gnuabiv2hf, specify a custom image in `Cross.toml`.

If I use the image in Cross.toml, I can run it successfully.

[target.csky-unknown-linux-gnuabiv2hf]
image = "csky"

Therefore, I want to know if it is desifned like this or it's a bug.

Which operating system is the host (e.g computer cross is on) running?

What architecture is the host?

What container engine is cross using?

cross version

cross 0.2.5

Emilgardis commented 10 months ago

Hi! This was fixed recently with https://github.com/cross-rs/cross/pull/1340

You can also just specify a dummy image, it won't use it unless you use it in the dockerfile

So either use cross which includes #1340 cargo install cross --git https://github.com/cross-rs/cross or specify

[target.csky-unknown-linux-gnuabiv2hf]
image = "csky-cross"
dockerfile = "./path/to/docker/dockerfile"