1010# implied.
1111# See the License for the specific language governing permissions and
1212# limitations under the License.
13- FROM fedora:32
13+ FROM fedora:33
1414
15- RUN dnf --disablerepo updates-modular --disablerepo fedora-modular \
16- install -y git gcc python3-devel python3-setuptools python3-pip nmap-ncat procps-ng
15+ LABEL description= "APImon (OpenStack API monitoring) container"
16+ LABEL maintainer= "Open Telekom Cloud (ecosystem)"
1717
18- WORKDIR /usr/app
19- ENV PATH=/root/.local/bin:$PATH
20- RUN mkdir -p /var/{lib/apimon,log/apimon}
18+ RUN dnf --disablerepo updates-modular --disablerepo fedora-modular \
19+ install -y git gcc nmap-ncat procps-ng net-tools xz \
20+ python3-devel python3-setuptools python3-pip \
21+ python3-psycopg2 python3-sqlalchemy \
22+ python3-dns && dnf clean all
2123
2224RUN git config --global user.email "apimon@test.com"
2325RUN git config --global user.name "apimon"
2426
27+ RUN useradd apimon
28+
29+ RUN mkdir -p /var/{lib/apimon,log/apimon,log/executor,log/scheduler}
30+
31+ RUN chown apimon:apimon /var/lib/apimon && chown -R apimon:apimon /var/log/apimon
32+
33+ WORKDIR /usr/app
34+
2535COPY ./requirements.txt /usr/app/requirements.txt
2636
27- # RUN git clone https://github.com/ansible/ansible --branch stable-2.10 && \
28- # git clone https://review.opendev.org/openstack/openstacksdk
37+ RUN \
38+ git clone https://github.com/opentelekomcloud/python-otcextensions && \
39+ # git clone https://github.com/ansible/ansible --branch stable-2.10 && \
40+ git clone https://review.opendev.org/openstack/openstacksdk
2941
30- # RUN cd ansible && python3 setup.py install --user
42+ RUN pip3 install -r /usr/app/requirements.txt
3143
32- RUN pip3 install --user -r /usr/app/requirements.txt
44+ # RUN cd ansible && python3 setup.py install --user
45+ RUN cd openstacksdk && python3 setup.py install --force
46+ RUN cd python-otcextensions && python3 setup.py install --force
3347
3448ADD . /usr/app/apimon
3549
@@ -39,8 +53,10 @@ ADD . /usr/app/apimon
3953# && git checkout FETCH_HEAD \
4054# && python3 setup.py install --user
4155
42- RUN cd apimon && python3 setup.py install --user
56+ RUN cd apimon && python3 setup.py install
57+
58+ RUN rm -rf /usr/app/{ansible,apimon,python-otcextensions}
4359
44- RUN rm -rf /usr/app/ansible
60+ USER apimon
4561
46- ENV PATH=/root/.local/bin:$PATH
62+ ENV HOME=/home/apimon
0 commit comments