Though this was working last week, suddenly now while building docker image for my rust application the following command fails-
RUN cargo install --target x86_64-unknown-linux-musl --path .
with errors-
Compiling ed25519 v1.4.0 error: edition 2021 is unstable and only available with -Z unstable-options.
error: failed to compile config-client v0.1.0 (/home/rust/src), intermediate artifacts can be found at /home/rust/src/target
Caused by:
could not compile ed25519
Following is my Cargo.toml file:
[package]
name = "application-xyz"
version = "0.1.0"
authors = ["Dev Team <dev@abc.com>"]
edition = "2018"
[dependencies]
anyhow = "1.0"
bytes = "1.0.1"
clap = "2.33.3"
log = "0.4.14"
log4rs = "1.0.0"
mustache = "0.9.0"
nats = "0.9.7"
prost = "0.7"
prost-types = "0.7"
reqwest = { version = "0.11.3", features = ["blocking", "json"] }
serde = { version = "1.0.125", features = ["derive"] }
[build-dependencies]
prost-build = "0.7"
My docker file is:
FROM containers.abc.com/rust-musl-builder:1.51 as builder
#Add protobuf sources as well as app source code.
COPY model/src ./model/src
COPY application-xyz:/build.rs ./build.rs
COPY application-xyz:/Cargo.toml ./Cargo.toml
COPY application-xyz:/src ./src
COPY application-xyz:/src/protobuf ./src/protobuf
RUN cargo install --target x86_64-unknown-linux-musl --path .
Any fix for this? Why cargo tries to download from 'edition 2021' though 'edition 2018' was specified? And why it downloads almost all the libraries though it has not been specified anywhere?