尝试构建 pkt 矿工映像以部署到 akash。
继续出现此错误
Error invoking remote method 'docker-start-container': Error: (HTTP code 400) unexpected - OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "./target/release/packetcrypt": stat ./target/release/packetcrypt: no such file or directory: unknown
我的 Dockerfile
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install -y \
build-essential \
curl
RUN apt-get update
RUN curl -y --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
RUN apt install make
RUN apt-get -y update
RUN apt-get -y install gcc git
RUN apt-get -y update
RUN git clone https://github.com/cjdelisle/packetcrypt_rs
ENV PATH=$PATH:/usr/local/packetcrypt_RS
CMD [ "~/", ".cargo/bin/cargo", "build", "--release" ]
CMD [ "./target/release/packetcrypt", "ann", "-p", "pkt1qd5skpmelkwvzy5vppqhafvmx0n5kqy97eglp00", "http://pool.pkteer.com" ]
答案1
您的 docker 文件实际上从未构建代码。 CMD 是一条在容器运行时运行某些东西的指令,但你只能放一次。第二个优先于第一个。你应该改变这个:
CMD [ "~/", ".cargo/bin/cargo", "build", "--release" ]
到
RUN ~/.cargo/bin/cargo build --release
然而从你的问题中也不清楚这是否有效。我不明白 .cargo 是如何创建的。