fix dockerfile caching trhingy
Some checks failed
Build and Test / account (push) Has been cancelled

This commit is contained in:
redbinder0526 2026-04-28 20:47:20 +02:00
commit ff635f49da

View file

@ -6,15 +6,16 @@ RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static protobuf-dev lld
WORKDIR /app WORKDIR /app
# this optimizes build time by putting the dependencies in a seperate docker layer, speeding up future builds
COPY Cargo.toml Cargo.lock ./ COPY Cargo.toml Cargo.lock ./
COPY mii ./mii COPY mii ./mii
RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo fetch RUN mkdir src && echo "fn main() {println!(\"dummy\");}" > src/main.rs
RUN OPENSSL_STATIC=1 cargo build --target x86_64-unknown-linux-musl --profile prod
COPY . . COPY . .
ENV SQLX_OFFLINE=true RUN touch src/main.rs
ENV SQLX_OFFLINE=true
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl
FROM scratch AS final FROM scratch AS final