forked from dogtagpki/tomcatjss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (33 loc) · 1.2 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
#
# Copyright Red Hat, Inc.
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
ARG OS_VERSION="latest"
ARG COPR_REPO="@pki/master"
################################################################################
FROM registry.fedoraproject.org/fedora:$OS_VERSION AS tomcatjss-builder
ARG COPR_REPO
ARG BUILD_OPTS
# Enable COPR repo if specified
RUN if [ -n "$COPR_REPO" ]; then dnf install -y dnf-plugins-core; dnf copr enable -y $COPR_REPO; fi
# Import source
COPY . /tmp/tomcatjss/
WORKDIR /tmp/tomcatjss
# Build packages
RUN dnf install -y git rpm-build
RUN dnf builddep -y --spec tomcatjss.spec
RUN ./build.sh $BUILD_OPTS --work-dir=build rpm
################################################################################
FROM registry.fedoraproject.org/fedora:$OS_VERSION AS tomcatjss-runner
ARG COPR_REPO
EXPOSE 389 8080 8443
# Enable COPR repo if specified
RUN if [ -n "$COPR_REPO" ]; then dnf install -y dnf-plugins-core; dnf copr enable -y $COPR_REPO; fi
# Import packages
COPY --from=tomcatjss-builder /tmp/tomcatjss/build/RPMS /tmp/RPMS/
# Install packages
RUN dnf localinstall -y /tmp/RPMS/*; rm -rf /tmp/RPMS
# Install systemd to run the container
RUN dnf install -y systemd
CMD [ "/usr/sbin/init" ]