forked from cloudamqp/lavinmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.rpm
31 lines (28 loc) · 1.19 KB
/
Dockerfile.rpm
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
ARG build_image=84codes/crystal:latest-fedora-38
FROM $build_image AS builder
RUN dnf install -y --nodocs --setopt=install_weak_deps=False --repo=fedora,updates \
rpmdevtools rpmlint systemd-rpm-macros nodejs-npm make help2man
RUN rpmdev-setuptree
COPY lavinmq.spec /root/rpmbuild/SPECS/
ARG version
RUN sed -i -E "s/^(Version:).*/\1 $version/" /root/rpmbuild/SPECS/lavinmq.spec
RUN rpmlint /root/rpmbuild/SPECS/lavinmq.spec
WORKDIR /usr/src/lavinmq
COPY Makefile README.md LICENSE NOTICE CHANGELOG.md shard.yml shard.lock ./
COPY extras/lavinmq.service extras/config.ini extras/
COPY openapi/ openapi/
COPY static/ static/
COPY views/ views/
COPY src/ src/
RUN sed -i -E "s/(VERSION =) .*/\1 \"$version\"/" src/lavinmq/version.cr
RUN tar -czf /root/rpmbuild/SOURCES/lavinmq.tar.gz -C /usr/src lavinmq
ARG MAKEFLAGS=-j2
RUN rpmbuild -ba /root/rpmbuild/SPECS/lavinmq.spec
RUN rpmlint /root/rpmbuild/RPMS/* || true
FROM fedora:38 AS test
COPY --from=builder /root/rpmbuild/RPMS /tmp/RPMS
RUN find /tmp/RPMS -type f -exec dnf install -y {} \;
RUN lavinmq --version
# Copy the deb package to a scratch image, that then can be exported
FROM scratch
COPY --from=builder /root/rpmbuild/RPMS /root/rpmbuild/SRPMS .