-
Notifications
You must be signed in to change notification settings - Fork 154
/
pam-builder.dockerfile
38 lines (31 loc) · 1.02 KB
/
pam-builder.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM golang:1.11
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libpam0g-dev \
apt-utils \
libcurl4-gnutls-dev && \
rm -rf /var/lib/apt/lists/*
# Fetch and install the JSON library.
# Source is at: https://github.com/akheron/jansson
RUN wget https://www.digip.org/jansson/releases/jansson-2.11.tar.gz && \
tar -xvf jansson-2.11.tar.gz && \
cd jansson-2.11 && \
./configure --prefix=/usr && \
make && \
make check && \
make install
# Archive the JSON library contents for installation in the running container.
RUN cd /usr/lib && \
tar -cf jansson_lib libjansson* && \
mv jansson_lib /
COPY pam /pam
COPY docker/run.dockerfile /run.dockerfile
COPY docker/keys/id_rsa.pub /id_rsa.pub
COPY docker/etc/pam.d /pam.d
COPY docker/etc/sshd_config /sshd_config
COPY docker/create_user.sh /create_user.sh
WORKDIR /pam
RUN make clean && make
CMD tar -cf - \
-C /pam pam_opa.so \
-C / run.dockerfile id_rsa.pub pam.d sshd_config create_user.sh jansson_lib