-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
65 lines (51 loc) · 2.21 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
65
ARG BUILDER=registry.access.redhat.com/ubi8/ubi
FROM $BUILDER as builder
ENV LINSTOR_CLI_VERSION 1.24.0
ENV PYTHON_LINSTOR_VERSION 1.24.0
ENV LINSTOR_CLI_PKGNAME linstor-client
ENV LINSTOR_CLI_TGZ ${LINSTOR_CLI_PKGNAME}-${LINSTOR_CLI_VERSION}.tar.gz
ENV PYTHON_LINSTOR_PKGNAME python-linstor
ENV PYTHON_LINSTOR_TGZ ${PYTHON_LINSTOR_PKGNAME}-${PYTHON_LINSTOR_VERSION}.tar.gz
USER root
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical
RUN groupadd makepkg # !lbbuild
RUN useradd -m -g makepkg makepkg # !lbbuild
RUN yum install -y sudo # !lbbuild
RUN usermod -a -G wheel makepkg # !lbbuild
RUN yum install -y rpm-build python3 python3-setuptools make && yum clean all -y # !lbbuild
# one can not comment COPY
RUN cd /tmp && curl -sSf https://pkg.linbit.com/downloads/linstor/$PYTHON_LINSTOR_TGZ > $PYTHON_LINSTOR_TGZ # !lbbuild
RUN cd /tmp && curl -sSf https://pkg.linbit.com/downloads/linstor/$LINSTOR_CLI_TGZ > $LINSTOR_CLI_TGZ # !lbbuild
# =lbbuild COPY /dist/${PYTHON_LINSTOR_TGZ} /tmp/
# =lbbuild COPY /dist/${LINSTOR_TGZ} /tmp/
USER makepkg
RUN cd ${HOME} && \
cp /tmp/${PYTHON_LINSTOR_TGZ} ${HOME} && \
tar xvf ${PYTHON_LINSTOR_TGZ} && \
cd ${PYTHON_LINSTOR_PKGNAME}-${PYTHON_LINSTOR_VERSION} && \
make gensrc && \
make rpm && mv ./dist/*.rpm /tmp/
RUN cd ${HOME} && \
cp /tmp/${LINSTOR_CLI_TGZ} ${HOME} && \
tar xvf ${LINSTOR_CLI_TGZ} && \
cd ${LINSTOR_CLI_PKGNAME}-${LINSTOR_CLI_VERSION} && \
make rpm && mv ./dist/*.rpm /tmp/
FROM registry.access.redhat.com/ubi8/ubi
MAINTAINER Roland Kammerer <roland.kammerer@linbit.com>
# ENV can not be shared between builder and "main"
ENV LINSTOR_CLI_VERSION 1.24.0
ARG release=1
LABEL name="linstor-client" \
vendor="LINBIT" \
version="$LINSTOR_CLI_VERSION" \
release="$release" \
summary="LINSTOR's client component" \
description="LINSTOR's client component"
COPY COPYING /licenses/gpl-3.0.txt
COPY --from=builder /tmp/*.noarch.rpm /tmp/
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
yum install -y /tmp/python-linstor-*.rpm /tmp/linstor-client*.rpm && yum clean all -y
RUN groupadd linstor
RUN useradd -m -g linstor linstor
USER linstor
ENTRYPOINT ["linstor"]