Skip to content

Commit

Permalink
UID/GID non-unique fix
Browse files Browse the repository at this point in the history
Complete details for PR: sameersbn/docker-postgresql#78

allow non-unique id's, because the gid selected by the user may already be in use within the container. This fix solves that issue.

Docker error log:
```
Adapting uid and gid for postgres:postgres to 1024:101
groupmod: GID '101' already exists
```

Error within log means that GID: 101 is already in use within the container.
By using groupmod with option ```-o``` it will be allowed.
  • Loading branch information
gjrtimmer committed Aug 31, 2016
1 parent d2c4247 commit c80bd87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ map_uidgid() {
USERMAP_UID=${USERMAP_UID:-$USERMAP_ORIG_UID}
if [[ ${USERMAP_UID} != ${USERMAP_ORIG_UID} ]] || [[ ${USERMAP_GID} != ${USERMAP_ORIG_GID} ]]; then
echo "Mapping UID and GID for ${GITLAB_USER}:${GITLAB_USER} to $USERMAP_UID:$USERMAP_GID"
groupmod -g ${USERMAP_GID} ${GITLAB_USER}
groupmod -o -g ${USERMAP_GID} ${GITLAB_USER}
sed -i -e "s|:${USERMAP_ORIG_UID}:${USERMAP_GID}:|:${USERMAP_UID}:${USERMAP_GID}:|" /etc/passwd
find ${GITLAB_HOME} -path ${GITLAB_DATA_DIR}/\* -prune -o -print0 | xargs -0 chown -h ${GITLAB_USER}:
fi
Expand Down

0 comments on commit c80bd87

Please sign in to comment.