-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
46 lines (35 loc) · 1.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
FROM ruby:3.3.6-alpine3.19 as ruby
ARG GEMFILE=allure-report-publisher.gem
# Build stage
#
FROM ruby as build
ARG BUNDLE_WITHOUT=development:release
ARG GEMFILE
WORKDIR /build
# Install build dependencies
RUN apk update && apk add --no-cache build-base
# Copy dependency files needed for install first to fetch from cache if unchanged
COPY Gemfile allure-report-publisher.gemspec ./
COPY lib/allure_report_publisher/version.rb ./lib/allure_report_publisher/version.rb
COPY exe/allure-report-publisher exe/allure-report-publisher
RUN bundle install
COPY ./ ./
RUN gem build -o ${GEMFILE}
# Production stage
#
FROM ruby as production
# Install allure
ARG ALLURE_VERSION=2.32.0
ENV PATH=$PATH:/usr/local/allure-${ALLURE_VERSION}/bin
RUN apk --no-cache add openjdk21 --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
RUN set -eux; \
wget -O allure.tgz https://github.com/allure-framework/allure2/releases/download/${ALLURE_VERSION}/allure-${ALLURE_VERSION}.tgz; \
tar -xzf allure.tgz -C /usr/local && rm allure.tgz; \
allure --version
# Install allure-report-publisher
ARG GEMFILE
COPY --from=build /build/${GEMFILE} ${GEMFILE}
RUN set -eux; \
gem install -N ${GEMFILE} && rm ${GEMFILE}; \
allure-report-publisher --version;
ENTRYPOINT [ "allure-report-publisher" ]