Closed h3zh1 closed 2 months ago
I'm not sure what these screenshots are supposed to show. Where is the installation logs? Why is RUN /xargo.sh
underlined?
Sorry, my picture is not particularly accurate. The underline is to show that RUN apt...
is not executed under cargo.
pic1: I pulled the image from ghcr.io and ran apt list to find it. I couldn't find the corresponding package "https://github.com/cross-rs/cross/blob/main/docker/Dockerfile.x86_64-unknown-linux-gnu#L15"
pic2: I re-run cargo build-docker-image x86_64-unknown-linux-gnu --tag latest --no -cache
, the new screenshot is as follows
the image built with cargo build-docker-image
is tagged with :local
, not :main
There's also some confusion here about what Dockerfile cargo build-docker-image x86-64-unknown-linux-gnu
uses, it actually uses Dockerfile.native
when target=platform
Oh, it seems that he parsed Dockerfile.native instead of "Dockerfile.x86_64-unknown-linux-gnu"
When the target is "x86_64-unknown-linux-gnu", Dockerfile.native is loaded.
But when the target is "i686-unknown-linux-gnu", Dockerfile.i686-unknown-linux-gnu
is loaded correctly.
And I tried to use another ubuntu to execute cargo build-docker-image i686-unknown-linux-gnu --tag local
and cargo build-docker-image x86_64-unknown-linux-gnu --tag local
, error still exists
Yes, that is not a problem, it's supposed to be that way.
I'm not sure what this issue is about anymore, can we close it?
Now I understand the usage, but loading Dockerfile.native is a little uncomfortable when I build image for "x86_64-unknown-linux-gnu" locally. Thanks, we can close it.
To explain a bit, the reason .native is used is because we want to support using the images for other platforms. On x86_64-unknown-linux-gnu we cant install libc6-dev-amd64-cross
, we just install libc6
, so to make it easy, when image platform=target, we switch to .native
Checklist
Describe your issue
I tried to build the docker image locally, I used apt to download
g++-x86-64-linux-gnu
andprotobuf-compiler
etc. But these don't seem to take effect. Can I only define them in pre-build or .sh? cargo build image: the content in Dockerfile But apt cannot find itWhat target(s) are you cross-compiling for?
x86_64-unknown-linux-gnu
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 (d8631fe 2024-08-17)
Example
No response
Additional information / notes
No response