Skip to content

Add libnss_wrapper and a wrapper to use it #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ RUN apk update --no-cache && apk add \

RUN echo "git-sync:x:65533:65533::/tmp:/sbin/nologin" >> /etc/passwd

# Compile libnss_wrapper (see https://bugs.alpinelinux.org/issues/6710)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we switch to debian as a base, this gets easier right?

Yes we can remove this build part

RUN apk add --no-cache --virtual .nss_wrapper-build-deps git build-base cmake cmocka-dev && \
git clone git://git.samba.org/nss_wrapper.git && \
cd nss_wrapper && \
mkdir build && \
cd build/ && \
mkdir -p /usr/local/include/ && \
echo -e "#ifndef NSS__H\n#define NSS__H\n\nenum nss_status\n{\n\tNSS_STATUS_TRYAGAIN = -2,\n\tNSS_STATUS_UNAVAIL = -1,\n\tNSS_STATUS_NOTFOUND = 0,\n\tNSS_STATUS_SUCCESS = 1,\n\tNSS_STATUS_RETURN = 2\n};\n\n#endif" > /usr/local/include/nss.h && \
cmake .. -DUNIT_TESTING:BOOL=ON && \
make && \
make CTEST_OUTPUT_ON_FAILURE=TRUE test && \
make install && \
rm -fr /nss_wrapper

ADD nss_wrapper.sh /nss_wrapper.sh

WORKDIR /tmp
USER git-sync:nobody
ENTRYPOINT ["/{ARG_BIN}"]
6 changes: 6 additions & 0 deletions nss_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

echo "git-sync:x:$(id -u):$(id -g):git-sync:/tmp:/bin/sh" > /tmp/passwd
echo "git-sync:x:$(id -g):" > /tmp/group

exec /git-sync $*