Skip to content

Commit 982f183

Browse files
committed
chore: udpate podman socket.
1 parent 398c41c commit 982f183

2 files changed

Lines changed: 28 additions & 28 deletions

File tree

docker/build/movement/entry.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ find /nix/store -type d -path '*/bin' | paste -sd: -
88
export PATH="/nix/store:$(find /nix/store -type d -path '*/bin' | paste -sd: -):$PATH"
99
echo "PATH: $PATH"
1010

11-
# Start Podman machine if not running
12-
if ! podman machine inspect podman-machine-default --format '{{.State}}' 2>/dev/null | grep -q 'running'; then
11+
# Check if podman machine exists and is running
12+
if ! podman machine inspect podman-machine-default &>/dev/null; then
13+
echo "Initializing podman machine..."
14+
podman machine init
15+
podman machine start
16+
elif ! podman machine inspect podman-machine-default --format '{{.State}}' | grep -q 'running'; then
1317
echo "Starting podman machine..."
1418
podman machine start
1519
fi
1620

17-
# Wait for podman socket
18-
timeout=30
19-
elapsed=0
20-
while [ ! -S "$DOCKER_HOST" ]; do
21-
echo "Waiting for podman socket..."
22-
sleep 1
23-
elapsed=$((elapsed + 1))
24-
if [ "$elapsed" -ge "$timeout" ]; then
25-
echo "Timed out waiting for podman socket."
26-
exit 1
27-
fi
28-
done
21+
# Find the actual podman socket location
22+
PODMAN_SOCKET=$(find /tmp/nix-shell.*/podman -name "podman-machine-default-api.sock" -type s 2>/dev/null | head -n 1)
23+
if [ -n "$PODMAN_SOCKET" ]; then
24+
export DOCKER_HOST="unix://$PODMAN_SOCKET"
25+
echo "Set DOCKER_HOST to Podman socket: $DOCKER_HOST"
26+
else
27+
echo "Warning: Could not find Podman socket"
28+
fi
2929

3030
echo "Podman socket ready. Launching application..."
3131
exec /app/movement "$@"

docker/build/mtma/entry.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ find /nix/store -type d -path '*/bin' | paste -sd: -
88
export PATH="/nix/store:$(find /nix/store -type d -path '*/bin' | paste -sd: -):$PATH"
99
echo "PATH: $PATH"
1010

11-
# Start Podman machine if not running
12-
if ! podman machine inspect podman-machine-default --format '{{.State}}' 2>/dev/null | grep -q 'running'; then
11+
# Check if podman machine exists and is running
12+
if ! podman machine inspect podman-machine-default &>/dev/null; then
13+
echo "Initializing podman machine..."
14+
podman machine init
15+
podman machine start
16+
elif ! podman machine inspect podman-machine-default --format '{{.State}}' | grep -q 'running'; then
1317
echo "Starting podman machine..."
1418
podman machine start
1519
fi
1620

17-
# Wait for podman socket
18-
timeout=30
19-
elapsed=0
20-
while [ ! -S "$DOCKER_HOST" ]; do
21-
echo "Waiting for podman socket..."
22-
sleep 1
23-
elapsed=$((elapsed + 1))
24-
if [ "$elapsed" -ge "$timeout" ]; then
25-
echo "Timed out waiting for podman socket."
26-
exit 1
27-
fi
28-
done
21+
# Find the actual podman socket location
22+
PODMAN_SOCKET=$(find /tmp/nix-shell.*/podman -name "podman-machine-default-api.sock" -type s 2>/dev/null | head -n 1)
23+
if [ -n "$PODMAN_SOCKET" ]; then
24+
export DOCKER_HOST="unix://$PODMAN_SOCKET"
25+
echo "Set DOCKER_HOST to Podman socket: $DOCKER_HOST"
26+
else
27+
echo "Warning: Could not find Podman socket"
28+
fi
2929

3030
echo "Podman socket ready. Launching application..."
3131
exec /app/mtma "$@"

0 commit comments

Comments
 (0)