mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
This makes for a simpler setup, and reduces the likelihood a user runs into a strange issue.
25 lines
438 B
Bash
25 lines
438 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
USER="coder"
|
|
|
|
# Add a Coder user to run as in systemd.
|
|
if ! id -u $USER >/dev/null 2>&1; then
|
|
useradd \
|
|
--create-home \
|
|
--system \
|
|
--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
|