我的docker构建今天开始失败,我似乎不知道如何修复它。
本地编译仍在运行。当我试图创建一个项目的容器时,我得到了这个错误:
error[E0599]: no method named `decrypt_padded_vec` found for struct `Decryptor` in the current scope
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/p12-0.6.2/src/lib.rs:660:9
|
660 | rc2.decrypt_padded_vec::<Pkcs7>(data).ok()
| ^^^^^^^^^^^^^^^^^^ method not found in `Decryptor<Rc2>`
error[E0599]: no method named `decrypt_padded_vec` found for struct `Decryptor` in the current scope
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/p12-0.6.2/src/lib.rs:700:10
|
700 | tdes.decrypt_padded_vec::<Pkcs7>(data).ok()
| ^^^^^^^^^^^^^^^^^^ method not found in `Decryptor<TdesEde3>`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `p12` due to 2 previous errors
我注意到的一件事是,p12板条箱是用0.6.2建造的,而我当地的Cargo.lock使用0.6.0,这会是问题吗?
这是我的货物。toml:
[dependencies]
actix="0.12.0"
actix-rt="2.6.0"
futures-util = "0.3.21"
tokio-tungstenite = {version = "0.16.1", features=["native-tls"]}
tokio = {version = "1.16.1"}
tokio-rustls = "0.22.0"
url = "2.2.2"
serde = {version="1.0", features=["serde_derive", "derive"]}
serde_json = "1.0.78"
log = "0.4.14"
dashmap = "5.0.0"
lapin = { version = "2.0.1", features=["rustls"] }
log4rs = "1.0.0"
dotenv = "0.15.0"
rustls = {version="0.19.1", features=["dangerous_configuration"]}
reqwest = "0.11.9"
clap = { version = "3.0.14", features = ["derive"] }
[dependencies.uuid]
features = ["v4", "serde", "v5"]
version = "0.8.2"
[dependencies.sqlx]
default_features = false
features = ["postgres", "macros", "chrono", "runtime-actix-rustls", "uuid", "offline"]
version = "0.5.9"
这是我的档案:
FROM rust:1.57-slim as base
ENV USER=root
ENV SQLX_OFFLINE=true
WORKDIR /code
RUN cargo init
COPY sqlx-data.json /code/sqlx-data.json
COPY Cargo.toml /code/Cargo.toml
COPY .env /code/.env
COPY logging_config.yaml /code/logging_config.yaml
RUN apt-get update -y
RUN apt-get install apt-utils
RUN apt-get install -y pkg-config
RUN apt-get install -y libssl-dev
# Cargo fetch is super slow (sometimes)
RUN cargo fetch
# RUN git fetch --force --update-head-ok 'https://github.com/rust-lang/crates.io-index' 'refs/heads/master:refs/remotes/origin/master' 'HEAD:refs/remotes/origin/HEAD'
COPY src /code/src
FROM base as builder
RUN cargo build --release
FROM builder
COPY --from=builder /code/target/release/robot-websocket-client /usr/bin/robot-websocket-client
CMD ["/usr/bin/robot-websocket-client", "-r", "fakebot"]
目前,我认为罪魁祸首是v0.6.2的不同版本,但在Cargo.toml文件中设置特定版本并没有解决问题。
任何见解都将不胜感激。如果你需要更多信息,请告诉我。谢谢你,
您可以通过cargo.toml
中的=X.Y.Z
指定特定的依赖版本。这似乎解决了问题:
p12 = "=0.6.0"