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

Can't make use of cargo or rustup while container building. #13

Open
IamTheCarl opened this issue Dec 18, 2021 · 1 comment
Open

Can't make use of cargo or rustup while container building. #13

IamTheCarl opened this issue Dec 18, 2021 · 1 comment

Comments

@IamTheCarl
Copy link

Hello.
For my use case, I need to install a few extra toolchains for cross-compiling.

Trying to call rustup to install the target toochains fails during container build, wether I use rustup or /usr/local/cargo/bin/rustup.
I'm starting to suspect that rustup is not installed until after the image has completed building.
Is this correct?

Is there a recommended workaround?

@matschaffer
Copy link

I do toolchain installation as part of my docker file https://github.com/matschaffer/zero2prod/blob/main/.devcontainer/Dockerfile

So far it seems like cargo is best handled via postCreateCommand https://github.com/matschaffer/zero2prod/blob/main/.devcontainer/devcontainer.json#L49

I tried moving it into the docker file but ran these issues:

  • Cargo space isn't writable by default, can chown around it but a little annoying
  • VScode frame is unusable until a long cargo install completes, seems like caching could make this better but I haven't found a good way to cache data between container rebuilds

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

No branches or pull requests

2 participants