nuxi-docker 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docker/Dockerfile +8 -2
- package/docker/change_gid.sh +9 -0
- package/package.json +1 -1
package/docker/Dockerfile
CHANGED
|
@@ -3,8 +3,14 @@ FROM node:20-bullseye-slim
|
|
|
3
3
|
ARG DOCKER_USER_UID
|
|
4
4
|
ARG DOCKER_USER_GID
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
COPY change_gid.sh /usr/local/bin/
|
|
7
|
+
|
|
8
|
+
# If the GID is in use, reassign it with a terrifying script
|
|
9
|
+
RUN chmod +x /usr/local/bin/change_gid.sh \
|
|
10
|
+
&& /usr/local/bin/change_gid.sh "$DOCKER_USER_GID"
|
|
11
|
+
|
|
12
|
+
RUN groupmod -g $DOCKER_USER_GID node \
|
|
13
|
+
&& usermod -u $DOCKER_USER_UID -g $DOCKER_USER_GID node
|
|
8
14
|
|
|
9
15
|
RUN npm install -g pnpm bun
|
|
10
16
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
DOCKER_USER_GID="$1"
|
|
4
|
+
EXISTING_GROUP=$(getent group "$DOCKER_USER_GID")
|
|
5
|
+
|
|
6
|
+
if [ -n "$EXISTING_GROUP" ]; then
|
|
7
|
+
NEW_GID=$(getent group | cut -d: -f3 | grep -E "^1[0-9]{3}$" | sort -n | tail -n 1 | awk '{ print $1+1 }')
|
|
8
|
+
groupmod -g "$NEW_GID" "$(echo "$EXISTING_GROUP" | cut -d: -f1)"
|
|
9
|
+
fi
|