(I am adding this question after finding the solution as there was no matches for my error when I needed it.)
After packaging a rust app as a docker container, I get the following error: Hyper error: invalid certificate: UnknownIssuer.
I have used the example from the official rust docker image (cf. https://hub.docker.com/_/rust/):
FROM rust:1.40 as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .
FROM debian:buster-slim
RUN apt-get update && apt-get install
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]
The issue was that the debian docker image does not include the ca-certificate package. The issue was solved using:
FROM rust:1.40 as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .
FROM debian:buster-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With