-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add dzil recipe This also serves as a very simple example of using our base perl image. * Dockerfile: a couple more fixes - Check aptfile for readability, not size, so it can be skipped if the file doesn't exist. - Do not auto-remove removable packages; removing them doesn't affect the overall image size anyway, and some packages (like runtime libraries auto-installed by their -dev counterparts) can be inadventently removed and break CPAN modules. * .github/workflows/test.yaml: Test dzil image as well This probably needs its own workflow later, but for now just do a quick build and check using the dzil image. * Dockerfile: invoke dumb-init on cpanm ONBUILD for signals handling This is important for cross-compile builds (e.g. amd64 to arm64) as cpanm/perl won't handle signals without defining them in the code, cf Perl/docker-perl#44. Without this, cross-compiles will appear to stall. * Move apt/cpan setup to script so we can call in sub-images too * dzil build should pull in authordeps and apply Pod::Inherit patch for the DERIV author bundle * Include Pod::Inherit @inc patch * Include CircleCI config as well * Update CircleCI docker orb * Latest orb does not have artifacts path for hadolint * List of dockerfiles now colon-separated * Switch to orb versions of build+publish * Clean up CircleCI config - no point running hadolint everywhere * Apply hadolint recommendations * Filter out some more hadolint checks * Try to set WORKDIR * Attempt to make job steps sequential * Apply `perl` context * CircleCI orb has several bugs, so the current version is not usable * Report $DOCKER_LOGIN to test context-is-broken hypothesis Co-authored-by: Zak B. Elep <[email protected]>
- Loading branch information
1 parent
e002a31
commit 10c8e8e
Showing
8 changed files
with
171 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
version: 2.1 | ||
orbs: | ||
docker: circleci/[email protected] | ||
jobs: | ||
perl: | ||
executor: docker/docker | ||
steps: | ||
- setup_remote_docker | ||
- checkout | ||
- run: | ||
command: | | ||
echo Log in as "$DOCKER_LOGIN" | ||
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_LOGIN" --password-stdin | ||
docker build -t deriv/perl . | ||
name: Build deriv/perl | ||
dzil: | ||
executor: docker/docker | ||
steps: | ||
- setup_remote_docker | ||
- checkout | ||
- run: | ||
command: | | ||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_LOGIN" --password-stdin | ||
cd dzil && docker build -t deriv/dzil . | ||
name: Build deriv/dzil | ||
workflows: | ||
version: 2 | ||
build-workflow: | ||
jobs: | ||
- perl: | ||
context: perl | ||
- dzil: | ||
context: perl | ||
requires: | ||
- perl | ||
- docker/hadolint: | ||
dockerfiles: Dockerfile:dzil/Dockerfile | ||
# Don't pin apt versions, we'll never remember to update them | ||
ignore-rules: DL3008,SC2046,DL3003,DL4006,DL3006 | ||
merged: | ||
jobs: | ||
- docker/publish: | ||
deploy: true | ||
image: deriv/perl | ||
filters: | ||
branches: | ||
only: /^master$/ | ||
- docker/publish: | ||
deploy: true | ||
image: deriv/dzil | ||
path: dzil | ||
filters: | ||
branches: | ||
only: /^master$/ | ||
- docker/hadolint: | ||
dockerfiles: Dockerfile:dzil/Dockerfile | ||
# Don't pin apt versions, we'll never remember to update them | ||
ignore-rules: DL3008,SC2046,DL3003,DL4006,DL3006 | ||
filters: | ||
branches: | ||
only: /^master$/ | ||
tagged: | ||
jobs: | ||
- docker/publish: | ||
deploy: true | ||
image: deriv/perl | ||
filters: | ||
branches: | ||
only: /^master$/ | ||
- docker/publish: | ||
deploy: true | ||
image: deriv/dzil | ||
path: dzil | ||
filters: | ||
branches: | ||
only: /^master$/ | ||
daily: | ||
jobs: | ||
- docker/publish: | ||
deploy: false | ||
image: deriv/perl | ||
- docker/publish: | ||
deploy: false | ||
image: deriv/dzil | ||
path: dzil | ||
- docker/hadolint: | ||
dockerfiles: Dockerfile:dzil/Dockerfile | ||
# Don't pin apt versions, we'll never remember to update them | ||
ignore-rules: DL3008,SC2046,DL3003,DL4006,DL3006 | ||
triggers: | ||
- schedule: | ||
cron: 05 19 * * * | ||
filters: | ||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG HTTP_PROXY | ||
FROM deriv/perl | ||
COPY pod-inherit.patch . | ||
RUN patch -p0 $(perldoc -lm Pod::Inherit) < pod-inherit.patch | ||
ONBUILD COPY cpanfile aptfile dist.ini /app/ | ||
ONBUILD RUN prepare-apt-cpan.sh \ | ||
&& dzil authordeps | cpanm -n | ||
ONBUILD COPY . /app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
libncurses-dev | ||
libreadline-dev | ||
git | ||
gcc | ||
make | ||
libc6-dev | ||
openssh-client | ||
patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requires 'Dist::Zilla::PluginBundle::Author::DERIV'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- a/Pod/Inherit.pm 2020-04-03 21:58:36.470197738 +0800 | ||
+++ b/Pod/Inherit.pm 2014-06-13 10:45:18.000000000 +0800 | ||
@@ -909,7 +909,7 @@ | ||
unless (exists $INC{$class_as_filename}) { | ||
# Still no source? Great... we'll have to pray that require will work... | ||
print "Still no source found for $classname; forced to use 'require'\n" if ($DEBUG && !$src); | ||
- my $did_it = $src ? do $src : Class::Load::load_optional_class($classname); | ||
+ my $did_it = $src ? do "./$src" : Class::Load::load_optional_class($classname); | ||
unless ($did_it) { | ||
my $err = $@; | ||
$err =~ s/ \(\@INC contains: .*\)//; | ||
@@ -994,7 +994,10 @@ | ||
$src = Path::Class::File->new($src)->as_foreign('Unix'); | ||
|
||
return <<__END_HEADER__; | ||
+=encoding utf8 | ||
+ | ||
=for comment POD_DERIVED_INDEX_GENERATED | ||
+ | ||
The following documentation is automatically generated. Please do not edit | ||
this file, but rather the original, inline with $classname | ||
at $src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# Prepare dependencies by installing anything found in `aptfile` | ||
# then applying CPAN modules from `cpanfile`. | ||
|
||
set -e | ||
|
||
if [ -r /app/aptfile ]; then | ||
apt-get -y -q update | ||
apt-get -y -q --no-install-recommends install $(cat /app/aptfile) | ||
fi | ||
cpanm --notest --installdeps . | ||
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 patch)') | ||
rm -rf /var/lib/apt/lists/* /var/cache/apt/* /root/.cpanm /tmp/* | ||
|