| 1 |
FROM registry.fedoraproject.org/fedora:27 |
| 2 |
LABEL \ |
| 3 |
name="latchset/custodia" \ |
| 4 |
maintainer="Christian Heimes <[email protected]>" \ |
| 5 |
url="https://latchset.github.io/" |
| 6 |
|
| 7 |
# install updates and custodia dependencies |
| 8 |
RUN dnf -y update \ |
| 9 |
&& dnf -y install \ |
| 10 |
python3 python3-pip python3-wheel \ |
| 11 |
python3-requests python3-six python3-jwcrypto \ |
| 12 |
python3-ipaclient \ |
| 13 |
&& dnf clean all |
| 14 |
|
| 15 |
# Create Custodia user and group |
| 16 |
# sum(ord(c) for c in 'cust') == 447 |
| 17 |
RUN groupadd -r custodia -g ${CUSTODIA_GID:-447} \ |
| 18 |
&& useradd -u ${CUSTODIA_GID:-447} -r -g custodia -d /var/lib/custodia -s /bin/bash -c "Custodia" custodia |
| 19 |
|
| 20 |
# Directories |
| 21 |
RUN install -d -m 755 -o custodia -g custodia \ |
| 22 |
/etc/custodia \ |
| 23 |
/var/log/custodia \ |
| 24 |
/var/run/custodia \ |
| 25 |
/var/lib/custodia |
| 26 |
VOLUME ["/etc/custodia", "/var/log/custodia", "/var/lib/custodia", "/var/run/custodia"] |
| 27 |
|
| 28 |
# Copy default custodia conf |
| 29 |
COPY contrib/config/custodia/custodia.conf /etc/custodia/ |
| 30 |
COPY contrib/docker/demo.conf /etc/custodia/ |
| 31 |
RUN chown custodia:custodia /etc/custodia/*.conf \ |
| 32 |
&& chmod 644 /etc/custodia/*.conf |
| 33 |
CMD ["/usr/bin/custodia", "/etc/custodia/custodia.conf"] |
| 34 |
|
| 35 |
# Copy and install wheel package |
| 36 |
COPY dist/custodia*.whl /tmp |
| 37 |
RUN pip3 install --disable-pip-version-check --no-cache-dir --no-deps \ |
| 38 |
--upgrade --pre /tmp/custodia*.whl |
| 39 |
|
| 40 |
USER custodia |