Skip to content
This repository was archived by the owner on Feb 13, 2020. It is now read-only.

Commit 651bd73

Browse files
committed
enabling dynamic /etc/passwd
1 parent 4ce13d5 commit 651bd73

File tree

3 files changed

+6
-36
lines changed

3 files changed

+6
-36
lines changed

Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LABEL maintainer = "giorgio.azzinnaro@gmail.com"
1111
RUN apt-get update && \
1212
apt-get -y install build-essential \
1313
python-setuptools python-pip python-dev \
14-
git curl gettext-base libnss-wrapper \
14+
git curl gettext-base \
1515
libssl-dev libreadline6-dev libkrb5-dev libffi-dev \
1616
libldap2-dev libsasl2-dev zlib1g-dev
1717

@@ -24,8 +24,9 @@ WORKDIR /home/ccs
2424
RUN pip install -r requirements-default.txt
2525

2626
# Create all runtime directories and ensure right permissions for OC
27-
RUN mkdir -p /var/db/caldavd /var/log/caldavd /var/run/caldavd && \
28-
chmod -R g+rwX /home/ccs /var/db/caldavd /var/log/caldavd /var/run/caldavd
27+
RUN mkdir -p /var/db/caldavd /var/log/caldavd /var/run/caldavd && \
28+
chmod -R g+rwX /home/ccs /var/db/caldavd /var/log/caldavd /var/run/caldavd && \
29+
chmod g=u /etc/passwd
2930

3031
# TODO Check if everything is in this dir
3132
VOLUME [ "/var/db/caldavd" ]

contrib/docker/docker_cmd.sh

+2-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@
22

33
# This is because OpenShift runs with random UIDs,
44
# and ccs expects the UID to be in /etc/passwd
5-
PASSWD_TEMP_FILE="/home/ccs/contrib/docker/passwd.template"
6-
PASSWD_FILE="/tmp/passwd"
7-
8-
export USER_ID=$(id -u)
9-
export GROUP_ID=$(id -g)
10-
envsubst < $PASSWD_TEMP_FILE > $PASSWD_FILE
11-
12-
export LD_PRELOAD=/usr/lib/libnss_wrapper.so
13-
export NSS_WRAPPER_PASSWD=$PASSWD_FILE
14-
export NSS_WRAPPER_GROUP=/etc/group
5+
# Must be done at runtime because of the dynamic UID
6+
echo "ccs:x:$(id -u):$(id -g):Calendar and Contacts Server:/home/ccs:/bin/bash" >> /etc/passwd
157

168
# Just get our conf file
179
CCS_CONF_TEMP_FILE="/home/ccs/contrib/docker/caldavd.plist.template"

contrib/docker/passwd.template

-23
This file was deleted.

0 commit comments

Comments
 (0)