-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDockerfile
64 lines (49 loc) · 2.28 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM registry.access.redhat.com/ubi8/ubi-minimal
ARG VAR_RPMS=""
RUN curl -o /etc/yum.repos.d/postgresql.repo \
https://copr.fedorainfracloud.org/coprs/g/insights/postgresql-16/repo/epel-8/group_insights-postgresql-16-epel-8.repo
RUN microdnf module enable nginx:1.20 || :
RUN microdnf module disable postgresql || :
RUN microdnf install -y --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \
python312 python3.12-pip python3-rpm python3-dnf which nginx rpm-devel git-core shadow-utils diffutils systemd libicu postgresql go-toolset \
$VAR_RPMS && \
ln -s /usr/lib64/python3.6/site-packages/rpm /usr/lib64/python3.12/site-packages/rpm && \
microdnf clean all
WORKDIR /vmaas
ADD pyproject.toml /vmaas/
ADD poetry.lock /vmaas/
ENV LC_ALL=C.utf8
ENV LANG=C.utf8
ARG VAR_POETRY_INSTALL_OPT="--only main"
RUN pip3.12 install --upgrade pip && \
pip3.12 install --upgrade poetry~=2.0 poetry-plugin-export
RUN poetry export $VAR_POETRY_INSTALL_OPT -f requirements.txt --output requirements.txt && \
pip3.12 install -r requirements.txt
RUN install -m 1777 -d /data && \
adduser --gid 0 -d /vmaas --no-create-home vmaas
RUN mkdir -p /vmaas/go/src/vmaas && chown -R vmaas:root /vmaas/go
ENV PYTHONPATH=/vmaas
ENV GOPATH=/vmaas/go \
PATH=$PATH:/vmaas/go/bin
ADD /vmaas-go /vmaas/go/src/vmaas
WORKDIR /vmaas/go/src/vmaas
RUN go mod download
RUN go build -v main.go
WORKDIR /vmaas
# Baked-in content for FedRAMP
ARG STATIC_ASSETS=0
RUN if [ "${STATIC_ASSETS}" == 1 ] ; then \
curl -o /etc/pki/ca-trust/source/anchors/2022-IT-Root-CA.crt https://certs.corp.redhat.com/certs/2022-IT-Root-CA.pem && \
update-ca-trust extract && \
git clone https://gitlab.cee.redhat.com/vmaas/vmaas-assets.git /vmaas/repolist_git ; \
fi
# remove testdata possibly containing vulnerable code
RUN rm -rf /vmaas/go/pkg/mod/github.com/gabriel-vasile/mimetype\@v1.4.6/testdata/
USER vmaas
ADD entrypoint.sh /vmaas/
ADD conf /vmaas/conf
ADD /database /vmaas/database
ADD /vmaas/webapp /vmaas/vmaas/webapp
ADD /vmaas/reposcan /vmaas/vmaas/reposcan
ADD /vmaas/common /vmaas/vmaas/common
ADD /vmaas/reposcan/redhatrelease/gen_package_profile.py /usr/local/bin