Comments (11)
The work-around I found is to run the following in the container or put it in my Dockerfile:
rustup self update \
&& rustup toolchain uninstall stable \
&& rustup toolchain install stable \
&& rustup default stable
from docker-rust.
rustup
is on version 1.15.0
inside the container.
The latest version is 1.16.0
which has the newest toolchains for Edition 2018.
from docker-rust.
Are you sure you're using the 1.31 image?
from docker-rust.
It seems to behave as expected to me:
$ docker run -it --rm rust:1.31.0
Unable to find image 'rust:1.31.0' locally
Trying to pull repository docker.io/library/rust ...
sha256:38e8d968efca2d041933ad22ff4d9587378cc82a37c30772f483a70d37ec2a3d: Pulling from docker.io/library/rust
54f7e8ac135a: Pull complete
d6341e30912f: Pull complete
087a57faf949: Pull complete
5d71636fb824: Pull complete
0c1db9598990: Pull complete
734ee16af2dd: Pull complete
Digest: sha256:38e8d968efca2d041933ad22ff4d9587378cc82a37c30772f483a70d37ec2a3d
Status: Downloaded newer image for docker.io/rust:1.31.0
root@afba971466a8:/# USER=root cargo new --edition 2018 foo
Created binary (application) `foo` package
root@afba971466a8:/# cd foo
root@afba971466a8:/foo# cat Cargo.toml
[package]
name = "foo"
version = "0.1.0"
authors = ["root"]
edition = "2018"
[dependencies]
root@afba971466a8:/foo# cargo build
Compiling foo v0.1.0 (/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.25s
root@afba971466a8:/foo# rustc --version
rustc 1.31.0 (abe02cefd 2018-12-04)
from docker-rust.
Are you sure you're using the 1.31 image?
Yes. But I'll remove the image and pull it again just to be sure.
Have you checked the rustup
version? There was a bug in the toolchain of the newest version that was fixed after 1.31.0 was released.
from docker-rust.
The version of rustc on the 1.31.0 image is 1.31.0.
from docker-rust.
Let me highlight that I am talking about rustup
, not rustc
.
The latest versions are:
- rustup 1.16.0
- rustc 1.31.0
Image 1.31.0 has rustc 1.31.0 indeed. But it isn't running rustup
1.15.0, which probably has the older toolchain.
Maybe that isn't the problem, but given that it was reported rustup
1.16.0 fixed a toolchain issue on rust 1.31.0, it would be good the rebuild this image with rustup
1.16.0.
from docker-rust.
That is not the problem.
from docker-rust.
If rustup
v1.16.0 is needed for 2018 code, then the problem is in the Dockerfile
, which is still using v1.15.0 of rustup-init
docker-rust/1.31.0/stretch/Dockerfile
Line 17 in e7703b2
$ docker run --rm -it rust:latest bash -c "rustc --version ; cargo --version ; rustup --version"
rustc 1.31.0 (abe02cefd 2018-12-04)
cargo 1.31.0 (339d9f9c8 2018-11-16)
rustup 1.15.0 (f0a3d9a84 2018-11-27)
from docker-rust.
Rustup 1.16.0 is not needed for 2018 code.
from docker-rust.
@sfackler You're right. The issue might have been just timing. Unfortunately, I can't find where I read the toolchain had to be updated shortly after Rust 2018 was released in order for this problem to go away.
I wrongly assumed rustup 1.15.0 was the problem, but 1.16.0 didn't change any of its behavior. Sorry about that.
So the problem was outside this image.
from docker-rust.
Related Issues (20)
- Create New Debian Testing (trixie) Images HOT 2
- I think we have another issue with 1.72. HOT 2
- rustc fails on 1.72.0-bookworm HOT 2
- Docker hub page update for debian:bookworm
- Builds randomly fail on Apple silicon using bind mounts with VirtioFS enabled HOT 5
- Update dockerhub page to use modern versions
- Remove $RUSTUP_HOME/share in Docker images HOT 4
- Latest Alpine images break SQL CLI build HOT 7
- When is the image rebuilt? HOT 1
- i386/rust:1.75.0 fails on Gitlab CI HOT 3
- [ FIXED ] Cannot build Rust App Docker Image because of: spurious network error ... HOT 8
- Add tags for nightly images HOT 4
- Nightly images are inaccessible HOT 1
- Missing apt sources HOT 5
- Missing apt sources HOT 3
- Docker Hub rust:alpine image fails to read crates.io with various "spurious network errors" HOT 2
- Alpine images has no layers built HOT 2
- Add user-friendly tags for Debian variants
- Missing tags for `1.77.1` images HOT 1
- 1.77.1 apt-get update fails with NO_PUBKEY
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-rust.