Skip to content

Perl Image followups #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build image
name: Build images

on:
push:
Expand All @@ -13,12 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build base perl image
- name: Build images
run: |
docker version
[ -n $DEBIAN_PROXY ] && docker_build_opts="--build-arg=DEBIAN_PROXY=${DEBIAN_PROXY}"
docker build "$docker_build_opts" -t deriv/perl .
cd dzil && docker build "$docker_build_opts" -t deriv/dzil .
- name: Inspect image creation and tag time
run: |
docker image inspect --format \'{{.Created}}\' deriv/perl
docker image inspect --format \'{{.Metadata.LastTagTime}}\' deriv/perl
docker image inspect --format \'{{.Created}}\' deriv/dzil
docker image inspect --format \'{{.Metadata.LastTagTime}}\' deriv/dzil
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,18 @@ ONBUILD ADD cpanfile aptfile /app/
# go through the CPAN deps. Once those are all done, remove anything
# that we would have pulled in as a build dep (compilers, for example)
# unless they happened to be in the aptfile.
ONBUILD RUN if [ -s /app/aptfile ]; then \
ONBUILD RUN if [ -r /app/aptfile ]; then \
apt-get -y -q update \
&& apt-get -y -q --no-install-recommends install $(cat /app/aptfile); \
fi \
&& cpanm --notest --quiet --installdeps --with-recommends . \
&& /usr/bin/dumb-init -- cpanm --notest --quiet --installdeps --with-recommends . \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why specifically cpanm requiring this? If it's a problem there, it'd be a problem everywhere, even apt install tends to run Perl code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if its even a Perl-only problem, as the case for this stems from cpanm subprocs like make/gcc/cc1 becoming zombies for some reason (hinting that some sub-parent is not handling signals,) and furthermore it doesn't happen on all cpanm installs. I agree that this might be placed further up in this RUN for the best coverage.

&& apt-get purge -y -q $(perl -le'@seen{split " ", "" . do { local ($/, @ARGV) = (undef, "/app/aptfile"); <> }} = () if -r "aptfile"; print for grep { !exists $seen{$_} } qw(make gcc git openssh-client libc6-dev libssl-dev zlib1g-dev)') \
&& apt-get -y --purge autoremove \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* /root/.cpanm /tmp/*

ONBUILD ADD . /app/

ONBUILD RUN rm -f /etc/apt/apt.conf.d/30proxy

ENTRYPOINT [ "/usr/bin/dumb-init", "--" ]

CMD [ "perl", "app.pl" ]
1 change: 1 addition & 0 deletions dzil/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM deriv/perl
9 changes: 9 additions & 0 deletions dzil/aptfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
gcc
git
make
openssh-client
libc6-dev
libssl-dev
zlib1g-dev
libncurses-dev
libreadline-dev
1 change: 1 addition & 0 deletions dzil/cpanfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requires 'Dist::Zilla::PluginBundle::Author::DERIV';