dockerize
This commit is contained in:
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
target
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
from mcluseau/rust:1.88.0 as build
|
||||
|
||||
workdir /app
|
||||
copy . .
|
||||
run \
|
||||
--mount=type=cache,id=rust-alpine-registry,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,id=rust-alpine-target,sharing=private,target=/app/target \
|
||||
cargo build --release \
|
||||
&& mkdir -p /dist \
|
||||
&& find target/release -maxdepth 1 -type f -executable -exec cp -v {} /dist/ +
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
from alpine:3.22
|
||||
copy --from=build /dist/ /bin/
|
||||
|
Reference in New Issue
Block a user