mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
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).*
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user