fix dockerfile caching trhingy
Some checks failed
Build and Test / account (push) Has been cancelled
Some checks failed
Build and Test / account (push) Has been cancelled
This commit is contained in:
parent
59ff59064c
commit
ff635f49da
1 changed files with 4 additions and 3 deletions
|
|
@ -6,15 +6,16 @@ RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static protobuf-dev lld
|
|||
|
||||
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 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 . .
|
||||
|
||||
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
|
||||
|
||||
FROM scratch AS final
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue