From 344be48b45b9477b1d81d193c7e351fdfbda32b9 Mon Sep 17 00:00:00 2001 From: Derek Date: Wed, 7 Aug 2024 13:05:54 -0700 Subject: [PATCH] update Dockerfile and Cargo.lock --- Cargo.lock | 8 ++++---- Dockerfile | 36 ++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d0aa45..1cd6ab7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2801,9 +2801,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -2822,9 +2822,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", diff --git a/Dockerfile b/Dockerfile index 54d03eb..0c2bcfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,29 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1-slim-buster AS chef -WORKDIR /app/ -RUN apt update && apt install -y libssl-dev pkg-config - -FROM chef AS planner - -COPY src ./src -COPY Cargo.toml . -COPY Cargo.lock . +FROM rust:alpine3.20 as builder + +# Install build dependencies +RUN apk update && apk add --no-cache \ + build-base \ + gcc \ + musl-dev \ + linux-headers \ + libressl-dev \ + pkgconfig \ + && rm -rf /var/cache/apk/* -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -COPY --from=planner /app/recipe.json recipe.json -RUN cargo chef cook --release --recipe-path recipe.json +WORKDIR /app/ COPY src ./src COPY Cargo.toml . COPY Cargo.lock . +RUN cargo update -p time # fix a type regression RUN cargo build --release -FROM debian:buster-slim -RUN apt update \ - && apt install -y openssl ca-certificates -RUN update-ca-certificates +FROM alpine:3.20 +RUN apk update && apk add --no-cache \ + ca-certificates \ + && rm -rf /var/cache/apk/* +# openssl? COPY --from=builder /app/target/release/cached-eth-rpc /app/cached-eth-rpc