Skip to content

Commit b823f84

Browse files
committed
Merge branch 'l-monninger/container-help-checks' of https://github.com/movementlabsxyz/movement-migration into l-monninger/container-help-checks
2 parents 1c5fdbd + 3cbfdd0 commit b823f84

5 files changed

Lines changed: 49 additions & 6 deletions

File tree

.github/workflows/build-push-containers-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
run-container-checks:
5555
needs:
56-
- build-push-checked-containers
56+
- build-push-checked-manifest
5757
uses: ./.github/workflows/container-check.yml
5858
with:
5959
container_checks: |

docker/build/movement/Dockerfile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,27 @@ WORKDIR /tmp/build
99
# Set build to docker to skip the podman initilization while opening the flake
1010
ENV BUILD=docker
1111

12-
# Build the Rust application
12+
RUN nix --extra-experimental-features "nix-command flakes" \
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
1320
RUN nix --extra-experimental-features "nix-command flakes" \
1421
develop .#docker-build --command bash -c "cargo build --release --bin movement"
1522

23+
1624
RUN rust_binary="./target/release/movement"; 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" {}
2133

2234
FROM alpine:3.22.0
2335

@@ -28,7 +40,10 @@ RUN adduser -u 1000 -D -s /bin/bash movement
2840

2941
# Copy binary and runtime deps
3042
COPY --from=builder /tmp/build/target/release/movement /app/movement
31-
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
3247

3348
# Environment setup
3449
ENV PATH="/nix/var/nix/profiles/default/bin:$PATH"

docker/build/movement/entry.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
set -e
44

5+
echo "Debugging nix store..."
6+
ls -al /nix-bin/store
7+
find /nix-bin/store -type d -path '*/bin' | paste -sd: -
8+
export PATH="/nix-bin/store:$(find /nix-bin/store -type d -path '*/bin' | paste -sd: -):$PATH"
9+
echo "PATH: $PATH"
10+
511
# Start Podman machine if not running
612
if ! podman machine inspect podman-machine-default --format '{{.State}}' 2>/dev/null | grep -q 'running'; then
713
echo "Starting podman machine..."

docker/build/mtma/Dockerfile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,28 @@ WORKDIR /tmp/build
99
# Set build to docker to skip the podman initilization while opening the flake
1010
ENV BUILD=docker
1111

12-
# Build the Rust application
1312
RUN 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

1624
RUN 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+
2134
FROM alpine:3.22.0
2235

2336
RUN 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
2942
COPY --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
3349
ENV PATH="/nix/var/nix/profiles/default/bin:$PATH"

docker/build/mtma/entry.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
set -e
44

5+
echo "Debugging nix store..."
6+
ls -al /nix-bin/store
7+
find /nix-bin/store -type d -path '*/bin' | paste -sd: -
8+
export PATH="/nix-bin/store:$(find /nix-bin/store -type d -path '*/bin' | paste -sd: -):$PATH"
9+
echo "PATH: $PATH"
10+
511
# Start Podman machine if not running
612
if ! podman machine inspect podman-machine-default --format '{{.State}}' 2>/dev/null | grep -q 'running'; then
713
echo "Starting podman machine..."

0 commit comments

Comments
 (0)