forked from fkie-cad/FACT_docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
40 lines (31 loc) · 1.47 KB
/
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
39
40
FROM ubuntu:focal
# Upgrade system and install dependencies of the installer
RUN apt -y update && apt -y upgrade && \
DEBIAN_FRONTEND="noninteractive" apt -y install --no-install-recommends \
ca-certificates \
git \
lsb-release \
patch \
sudo \
tzdata \
wget
RUN useradd -r --no-create-home -d /var/log/fact fact
RUN printf 'fact ALL=(ALL:ALL) NOPASSWD: ALL\n' > /etc/sudoers.d/99_fact
RUN mkdir /opt/FACT_core && chown fact: /opt/FACT_core
RUN mkdir /var/log/fact && chown fact: /var/log/fact
USER fact:fact
WORKDIR /var/log/fact
RUN git clone https://github.com/fkie-cad/FACT_core.git /opt/FACT_core
RUN /opt/FACT_core/src/install/pre_install.sh
RUN FACT_INSTALLER_SKIP_DOCKER=y /opt/FACT_core/src/install.py
# Apply some patches to the default config to make it _just work_ without any configuration
# The patched config is only needed during runtime and not during installation
COPY --chown=fact:fact 0000_uwsgi_bindip.patch /tmp/0000_uwsgi_bindip.patch
RUN patch /opt/FACT_core/src/config/uwsgi_config.ini < /tmp/0000_uwsgi_bindip.patch \
&& rm /tmp/0000_uwsgi_bindip.patch
COPY --chown=fact:fact 0001_main_cfg.patch /tmp/0001_main_cfg.patch
RUN patch /opt/FACT_core/src/config/main.cfg < /tmp/0001_main_cfg.patch \
&& rm /tmp/0001_main_cfg.patch
COPY --chown=fact:fact 0002_main_cfg.patch.template /opt/FACT_core/0002_main_cfg.patch.template
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]