From 49f135bcd46b81e039f7715ac4052b854d59b48e Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Mon, 26 Jan 2026 21:52:05 +1100 Subject: [PATCH] fix(.devcontainer): make post_start.sh idempotent (#21678) When running multiple instances of the coder/coder devcontainer, the `postStartCommand` fails with exit code 1: ``` postStartCommand from devcontainer.json failed with exit code 1 Command failed: ./.devcontainer/scripts/post_start.sh ``` `service docker start` returns exit code 1 when Docker is already running: | Docker State | Exit Code | |--------------|-----------| | Not running | 0 | | Already running | **1** | ## Fix Check if Docker is already running before attempting to start it: ```bash sudo service docker status >/dev/null 2>&1 || sudo service docker start ``` --- *This PR and description were generated by [Mux](https://mux.coder.com).* --- .devcontainer/scripts/post_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/scripts/post_start.sh b/.devcontainer/scripts/post_start.sh index c98674037d..1b87d801fd 100755 --- a/.devcontainer/scripts/post_start.sh +++ b/.devcontainer/scripts/post_start.sh @@ -1,4 +1,4 @@ #!/bin/sh # Start Docker service if not already running. -sudo service docker start +sudo service docker status >/dev/null 2>&1 || sudo service docker start