@@ -9,15 +9,28 @@ WORKDIR /tmp/build
99# Set build to docker to skip the podman initilization while opening the flake
1010ENV BUILD=docker
1111
12- # Build the Rust application
1312RUN nix --extra-experimental-features "nix-command flakes" \
14- develop .#docker-build --command bash -c "cargo build --release -p mtma"
13+ develop --command bash -c "mkdir -p /tmp/executables"
14+
15+ # Copy celestia-appd to /tmp/executables
16+ RUN nix --extra-experimental-features "nix-command flakes" \
17+ develop --command bash -c "cp \$ (which podman) /tmp/executables/podman"
18+
19+ # Build the Rust application
20+ RUN nix --extra-experimental-features "nix-command flakes" \
21+ develop .#docker-build --command bash -c "cargo build --release --bin mtma"
22+
1523
1624RUN rust_binary="./target/release/mtma" ; dest_dir="/tmp/runtime" ; \
1725 mkdir -p "$dest_dir" ; ldd "$rust_binary" | awk '{print $3}' | \
1826 grep '^/' | xargs -I {} dirname {} | sort | uniq | xargs -I {} \
1927 bash -c 'mkdir -p "$0/$1" && rsync -a --copy-links "$1/" "$0/$1/"' "$dest_dir" {}
2028
29+ RUN rust_binary="/tmp/executables/podman" ; dest_dir="/tmp/runtime" ; \
30+ mkdir -p "$dest_dir" ; ldd "$rust_binary" | awk '{print $3}' | \
31+ grep '^/' | xargs -I {} dirname {} | sort | uniq | xargs -I {} \
32+ bash -c 'mkdir -p "$0/$1" && rsync -a --copy-links "$1/" "$0/$1/"' "$dest_dir" {}
33+
2134FROM alpine:3.22.0
2235
2336RUN apk add --no-cache bash
@@ -27,7 +40,10 @@ RUN adduser -u 1000 -D -s /bin/bash mtma
2740
2841# Copy binary and runtime deps
2942COPY --from=builder /tmp/build/target/release/mtma /app/mtma
30- COPY --from=builder /tmp/runtime/nix/store /nix/store
43+ COPY --from=builder /nix/store /nix/store
44+
45+ # copy executables
46+ COPY --from=builder /tmp/executables/podman /usr/local/bin/podman
3147
3248# Environment setup
3349ENV PATH="/nix/var/nix/profiles/default/bin:$PATH"
0 commit comments