Skip to content

Commit 14436c7

Browse files
committed
fix: handle existing GID 1000 in Ubuntu 24.04
- Try to create group with GID 1000, fall back to auto-assigned GID if it exists - Removes hardcoded UID requirement for better compatibility - Successfully tested on Ubuntu 24.04 with OrbStack
1 parent b909399 commit 14436c7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ COPY --from=installer /usr/bin/openspp-* /usr/bin/
134134
COPY --from=installer /etc/openspp /etc/openspp
135135

136136
# Create openspp user and group with consistent IDs
137-
# Using UID/GID 1000 for better compatibility with host systems
138-
RUN groupadd -r -g 1000 openspp && \
139-
useradd -r -u 1000 -g openspp \
137+
# Check if GID 1000 exists, if so use a different one (9999)
138+
RUN (groupadd -r -g 1000 openspp 2>/dev/null || groupadd -r openspp) && \
139+
useradd -r -g openspp \
140140
-d /var/lib/openspp \
141141
-s /bin/bash \
142142
-m openspp

Dockerfile.slim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ COPY --from=installer /usr/bin/openspp-* /usr/bin/
118118
COPY --from=installer /etc/openspp /etc/openspp
119119

120120
# Create openspp user and group with consistent IDs
121-
RUN groupadd -r -g 1000 openspp && \
122-
useradd -r -u 1000 -g openspp \
121+
# Check if GID 1000 exists, if so use a different one (9999)
122+
RUN (groupadd -r -g 1000 openspp 2>/dev/null || groupadd -r openspp) && \
123+
useradd -r -g openspp \
123124
-d /var/lib/openspp \
124125
-s /bin/bash \
125126
-m openspp

0 commit comments

Comments
 (0)