@@ -64,8 +64,7 @@ sub die_with_sample {
64
64
savedPackages="make netbase" \
65
65
&& apt-mark auto '.*' > /dev/null \
66
66
&& apt-mark manual $savedPackages \
67
- && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
68
- && rm -fr /var/cache/apt/* /var/lib/apt/lists/*
67
+ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
69
68
EOF
70
69
chomp $docker_slim_run_purge ;
71
70
@@ -89,6 +88,13 @@ sub die_with_sample {
89
88
sha256 => " 9b60767fe40752ef7a9d3f13f19060a63389a5c23acc3e9827e19b75500f81f3" ,
90
89
);
91
90
91
+ # sha256 taken from http://cdn-fastly.deb.debian.org/debian/pool/main/t/tini/tini_0.18.0-1.dsc
92
+ my %tini = (
93
+ name => " tini-0.18.0" ,
94
+ url => " https://github.com/krallin/tini/archive/v0.18.0.tar.gz" ,
95
+ sha256 => " 1097675352d6317b547e73f9dc7c6839fd0bb0d96dafc2e5c95506bb324049a2" ,
96
+ );
97
+
92
98
die_with_sample unless defined $config -> {releases };
93
99
die_with_sample unless ref $config -> {releases } eq " ARRAY" ;
94
100
@@ -141,6 +147,7 @@ sub die_with_sample {
141
147
for my $build (keys %builds ) {
142
148
$release -> {url } = $url ;
143
149
$release -> {" cpanm_dist_$_ " } = $cpanm {$_ } for keys %cpanm ;
150
+ $release -> {" tini_dist_$_ " } = $tini {$_ } for keys %tini ;
144
151
145
152
$release -> {extra_flags } ||= ' ' ;
146
153
$release -> {debian_release } ||= [' buster' ];
@@ -155,7 +162,9 @@ sub die_with_sample {
155
162
156
163
my $output = $template ;
157
164
$output =~ s /\{\{ $_\}\} / $release ->{$_ }/ mg
158
- for (qw( version pause extra_flags sha256 type url image cpanm_dist_name cpanm_dist_url cpanm_dist_sha256) );
165
+ for (
166
+ qw( version pause extra_flags sha256 type url image cpanm_dist_name cpanm_dist_url cpanm_dist_sha256 tini_dist_name tini_dist_url tini_dist_sha256)
167
+ );
159
168
$output =~ s /\{\{ args\}\} / $builds {$build }/ mg ;
160
169
161
170
if ($build =~ / slim/ ) {
@@ -293,12 +302,24 @@ =head1 DESCRIPTION
293
302
&& {{test}} \
294
303
&& make install \
295
304
&& cd /usr/src \
305
+ && apt-get update \
306
+ && apt-get install -y --no-install-recommends cmake \
307
+ && curl -L {{tini_dist_url}} -o {{tini_dist_name}}.tar.gz \
308
+ && echo '{{tini_dist_sha256}} *{{tini_dist_name}}.tar.gz' | sha256sum -c - \
309
+ && tar -xzf {{tini_dist_name}}.tar.gz && cd {{tini_dist_name}} \
310
+ && CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37" \
311
+ && cmake . && make && make install \
312
+ && cd /usr/src \
296
313
&& curl -LO {{cpanm_dist_url}} \
297
314
&& echo '{{cpanm_dist_sha256}} *{{cpanm_dist_name}}.tar.gz' | sha256sum -c - \
298
315
&& tar -xzf {{cpanm_dist_name}}.tar.gz && cd {{cpanm_dist_name}} && perl bin/cpanm . && cd /root \
299
316
&& {{docker_slim_run_purge}} \
317
+ && apt-get purge -y --auto-remove cmake \
318
+ && rm -fr /var/cache/apt/* /var/lib/apt/lists/* \
319
+ && rm -fr /usr/src/{{tini_dist_name}}* \
300
320
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl /usr/src/{{cpanm_dist_name}}* /tmp/*
301
321
302
322
WORKDIR /root
303
323
324
+ ENTRYPOINT ["tini","--"]
304
325
CMD ["perl{{version}}","-de0"]
0 commit comments