Skip to content

Add Dockerfile for binary-com's standard perl image #1

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

Merged
merged 7 commits into from
Jul 16, 2020

Conversation

zakame
Copy link
Contributor

@zakame zakame commented Jun 19, 2020

This is mostly derived from https://github.com/tm604/perl-docker with a
few changes:

  • Use https://hub.docker.com/_/perl instead of building from
    debian:buster; this allows for source verification of both the Perl
    build and cpanm (which is already done on the official images) and a
    slightly slimmer build.
    Build our own perl on top of
    https://hub.docker.com/_/debian buster.

  • Forgo multi-stage build in favor of a smarter single-stage: we're due
    to install further dependencies on a later build trigger for
    derivative images anyway, so some core build essentials can be
    included here now for a batteries-included approach with less moving
    parts during the subsequent build triggers.

  • Add a sane ENTRYPOINT for correct behaviors when running on
    Kubernetes.

zakame added 3 commits June 19, 2020 13:53
This is mostly derived from https://github.com/tm604/perl-docker with a
few changes:

- Use https://hub.docker.com/_/perl instead of building from
  debian:buster; this allows for source verification of both the Perl
  build and cpanm (which is already done on the official images) and a
  slightly slimmer build.

- Forgo multi-stage build in favor of a smarter single-stage: we're due
  to install further dependencies on a later build trigger for
  derivative images anyway, so some core build essentials can be
  included here now for a batteries-included approach with less moving
  parts during the subsequent build triggers.

- Add a sane `ENTRYPOINT` for correct behaviors when running on
  Kubernetes.
@zakame zakame marked this pull request as ready for review June 24, 2020 03:09
@zakame zakame force-pushed the docker/standard-perl-image branch from 7beccbf to 1d6d4ef Compare June 25, 2020 06:43
- Add support for using an apt cache/proxy during builds.

- Rebase against debian:buster; we'd want to build our own perl that we
  can supply our own configuration flags in the future.

- Since we build our own perl (and cpanm) ensure we're doing some basic
  source validation for the tarballs; embed the SHA256 sums for now,
  figure a better way later.
&& cd App-cpanminus-1.7044 && /opt/perl-5.32.0/bin/perl bin/cpanm . \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl /usr/src/App-cpanminus-1.7044* /tmp/* \
# Locale support is probably quite useful in some cases, but
Copy link
Contributor

Choose a reason for hiding this comment

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

Still unsure whether we should keep this - clean Unicode handling is an important feature, so maybe we should enforce a .UTF-8 locale by default...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe, though with the current debian:buster base we already fall back to a C.UTF_8 locale:

root@558bed5a8132:/app# locale -a
C
C.UTF-8
POSIX
root@558bed5a8132:/app# ls /usr/lib/locale/
C.UTF-8
root@558bed5a8132:/app# locale
LANG=
LANGUAGE=
LC_ALL=

zakame added 2 commits July 1, 2020 11:59
When using https://github.com/nektos/act for running tests locally, one
can supply `$DEBIAN_PROXY` in .env file for act to use upon building the
image.

Also change the image name for consistency with Binary -> Deriv
rebranding.
Use our DERIV author name on CPAN, and move perl/cpanm version info and
checksums into environment variables for easy updating later.
@tom-binary tom-binary merged commit e002a31 into binary-com:master Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants