From abfae1b4aa4f0535c32994a61377a32661bdecdd Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Mon, 27 Jun 2022 14:12:43 -0500 Subject: [PATCH] fix: Add coder user to docker group on installation (#2693) This makes for a simpler setup, and reduces the likelihood a user runs into a strange issue. --- preinstall.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/preinstall.sh b/preinstall.sh index 932dab26b0..79614f195d 100644 --- a/preinstall.sh +++ b/preinstall.sh @@ -11,4 +11,14 @@ if ! id -u $USER >/dev/null 2>&1; then --user-group \ --shell /bin/false \ $USER + + # Add the Coder user to the Docker group. + # Coder is frequently used with Docker, so + # this prevents failures when building. + # + # It's fine if this fails! + usermod \ + --append \ + --groups docker \ + $USER 2>/dev/null || true fi