-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
190 lines (170 loc) · 5.59 KB
/
Containerfile
File metadata and controls
190 lines (170 loc) · 5.59 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# =============================================================================
# Stage 1: Build RT and compile CPAN dependencies
# =============================================================================
FROM quay.io/crunchtools/ubi10-httpd-perl AS builder
RUN --mount=type=secret,id=activation_key \
--mount=type=secret,id=org_id \
if [ -s /run/secrets/activation_key ] && [ -s /run/secrets/org_id ]; then \
subscription-manager register \
--activationkey="$(cat /run/secrets/activation_key)" \
--org="$(cat /run/secrets/org_id)"; \
fi
RUN dnf install -y \
expat-devel \
gcc \
make \
openssl-devel \
mariadb-connector-c-devel \
perl-CPAN \
perl-ExtUtils-MakeMaker \
gnupg2 \
&& dnf clean all
RUN subscription-manager unregister 2>/dev/null || true
# Create mysql_config symlink for DBD::mysql 4.x (mariadb-connector-c provides mariadb_config)
RUN ln -sf /usr/bin/mariadb_config /usr/bin/mysql_config
# Install cpanm for reliable automated CPAN installs
RUN curl -fsSL https://cpanmin.us | perl - App::cpanminus
# Install CPAN dependencies for RT 6.0.3 (split into layers for caching)
# Layer 1: Core framework deps (Moose stack, DBI, DateTime)
RUN cpanm --notest \
Moose \
MooseX::NonMoose \
MooseX::Role::Parameterized \
namespace::autoclean \
DBI
# DBD::mysql 4.050 has a my_bool/_Bool pointer type mismatch that GCC 14 treats as error
RUN PERL_MM_OPT="DEFINE=-Wno-error=incompatible-pointer-types" cpanm --notest DBD::mysql@4.050
RUN cpanm --notest DBD::MariaDB
RUN cpanm --notest \
DBIx::SearchBuilder \
DateTime \
DateTime::Format::Natural \
DateTime::Locale \
DateTime::Set \
Date::Extract \
Date::Manip
# Layer 2: Web stack (HTML, CSS, HTTP, Mason, Plack)
RUN cpanm --notest \
CGI \
CGI::Cookie \
CGI::Emulate::PSGI \
CGI::PSGI \
CSS::Inliner \
CSS::Minifier::XS \
CSS::Squish \
FCGI \
HTML::Entities \
HTML::FormatExternal \
HTML::FormatText::WithLinks \
HTML::FormatText::WithLinks::AndTables \
HTML::Gumbo \
HTML::Mason \
HTML::Mason::PSGIHandler \
HTML::Quoted \
HTML::RewriteAttributes \
HTML::Scrubber \
HTTP::Message \
JavaScript::Minifier::XS \
Plack \
Plack::Handler::Starlet \
Web::Machine \
Path::Dispatcher
# Layer 3: Email, encoding, network, crypto
RUN cpanm --notest \
Email::Address \
Email::Address::List \
Encode::Detect::Detector \
Encode::HanExtra \
LWP::Protocol::https \
LWP::Simple \
LWP::UserAgent \
Mail::Header \
Mail::Mailer \
MIME::Entity \
MIME::Types \
Mozilla::CA \
Net::CIDR \
Net::IP \
Crypt::Eksblowfish \
GnuPG::Interface \
PerlIO::eol
# Layer 4: Utilities and remaining deps
RUN cpanm --notest \
Apache::Session \
Business::Hours \
Class::Accessor::Fast \
Clone \
Convert::Color \
Data::GUID \
Data::ICal \
Data::Page \
Devel::GlobalDestruction \
Devel::StackTrace \
File::ShareDir \
Hash::Merge \
Hash::Merge::Extra \
Imager \
IPC::Run3 \
JSON \
List::MoreUtils \
Locale::Maketext::Fuzzy \
Locale::Maketext::Lexicon \
Log::Dispatch \
Module::Path \
Module::Refresh \
Module::Runtime \
Module::Versions::Report \
Parallel::ForkManager \
Regexp::Common \
Regexp::Common::net::CIDR \
Regexp::IPv6 \
Role::Basic \
Scope::Upper \
Sub::Exporter \
Symbol::Global::Name \
Term::ReadKey \
Text::Password::Pronounceable \
Text::Quoted \
Text::Template \
Text::WikiFormat \
Text::WordDiff \
Text::Wrapper \
Time::ParseDate \
Tree::Simple \
URI \
XML::RSS
# Download and install RT 6.0.3
# 6.0.3 includes upstream commit f8f03dd (2026-04-30): "Use raw content for JS
# squishing to avoid auto-decoding under Plack 1.0052" — the fix for the wide-
# character md5_hex crash that took down 6.0.2 on a cold squish cache. The local
# Squish/JS.pm sed patch we carried on 6.0.2 is no longer needed.
RUN curl -fsSL https://download.bestpractical.com/pub/rt/release/rt-6.0.3.tar.gz | tar xz -C /root
RUN cd /root/rt-6.0.3 && ./configure --with-db-type=mysql
RUN cd /root/rt-6.0.3 && make testdeps && make install
# =============================================================================
# Stage 2: Deploy (lean runtime image)
# =============================================================================
FROM quay.io/crunchtools/ubi10-httpd-perl-mariadb
RUN dnf install -y postfix && dnf clean all
# RHEL 10 dropped Berkeley DB hash maps; use lmdb instead
RUN postconf -e "alias_maps = lmdb:/etc/aliases" \
"alias_database = lmdb:/etc/aliases" && \
postalias lmdb:/etc/aliases
RUN systemctl enable postfix
# Copy RT from builder
COPY --from=builder /opt/rt6 /opt/rt6
COPY --from=builder /usr/lib64/perl5 /usr/lib64/perl5
COPY --from=builder /usr/share/perl5 /usr/share/perl5
COPY --from=builder /usr/local/share/perl5 /usr/local/share/perl5
COPY --from=builder /usr/local/lib64/perl5/ /usr/local/lib64/perl5/
# Fix ownership
RUN chown -R root:bin /opt/rt6/lib && chown -R root:apache /opt/rt6/etc
# RT 6.0.3 ships schema.mysql/acl.mysql but DatabaseType MariaDB looks for schema.MariaDB/acl.MariaDB
RUN ln -sf /opt/rt6/etc/schema.mysql /opt/rt6/etc/schema.MariaDB && \
ln -sf /opt/rt6/etc/acl.mysql /opt/rt6/etc/acl.MariaDB
# Copy init scripts, systemd units, and config files
COPY rootfs/ /
# Enable init services
RUN chmod +x /usr/local/bin/rt-db-prep.sh /usr/local/bin/rt-db-setup.sh /usr/local/bin/mail && \
systemctl enable rt-db-prep rt-db-setup
ENTRYPOINT ["/sbin/init"]