Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to override base image? #1471

Closed
1 of 2 tasks
fuzzypixelz opened this issue Apr 8, 2024 · 5 comments
Closed
1 of 2 tasks

Ability to override base image? #1471

fuzzypixelz opened this issue Apr 8, 2024 · 5 comments

Comments

@fuzzypixelz
Copy link

fuzzypixelz commented Apr 8, 2024

Checklist

Describe your request

Is it reasonable to make the Docker images accept a $BASE_IMAGE argument that a user can override to something like ubuntu-16.04 (e.g. for compatibility with systems that require older versions of glibc).

Describe why this would be a good inclusion for cross

No response

@Emilgardis
Copy link
Member

How would you use this? E.g what is the mechanism that switches base image? Does this only apply to our build-docker-image

We already have https://github.com/cross-rs/cross/blob/main/docs/custom_images.md#custom-image

@fuzzypixelz
Copy link
Author

fuzzypixelz commented Apr 9, 2024

How would you use this? E.g what is the mechanism that switches base image? Does this only apply to our build-docker-image

We already have https://github.com/cross-rs/cross/blob/main/docs/custom_images.md#custom-image

I meant exposing the base image as a build argument:

ARG BASE=ubuntu-20.04
FROM ${BASE}

# ...

Alas this wouldn't work if I try to override it when using cross images themselves as a base image.

My goal is getting cross images based on Ubuntu 16.04 (to support older versions of glibc). I tried to simply change it in the Dockerfiles and run cargo xtask build-docker-image x86_64-unknown-linux-gnu but that expectedly failed with Unable to locate package libgcc-s1:amd64. Who knows what other things will go wrong there.

@Emilgardis
Copy link
Member

I see, I don't think we'd be able to support this without many small fixes in many places, and 16.04 is not really maintained anymore. We will (eventually, far future) be merging all the pre-setup stuff into one base image, which would maybe help with your effort. See #953

I'll close this issue as it's not something we want to do, if you want to have older glibc I'd recommend you to look into crosstool-ng, which we can use to support older libraries. There's no documentation about how to do it but see cargo xtask configure-crosstool and one of the targets which uses that

@Emilgardis Emilgardis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
@fuzzypixelz
Copy link
Author

I see, I don't think we'd be able to support this without many small fixes in many places, and 16.04 is not really maintained anymore. We will (eventually, far future) be merging all the pre-setup stuff into one base image, which would maybe help with your effort. See #953

I'll close this issue as it's not something we want to do, if you want to have older glibc I'd recommend you to look into crosstool-ng, which we can use to support older libraries. There's no documentation about how to do it but see cargo xtask configure-crosstool and one of the targets which uses that

Thanks a lot! I'll look into the crosstool-ng option once I have the time and report my findings.

@Emilgardis
Copy link
Member

Oh yeah! I forgot about zig also which is the obvious way to do it :)

https://github.com/cross-rs/cross/blob/main/docs/config_file.md#targettargetzig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants