Skip to content
Open
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Cro Dockerfiles

These `Dockerfile`s define images that may be used when deploying services
built with [Cro](http://cro.services/). They are based on a recent [Rakudo
Star image](https://hub.docker.com/_/rakudo-star/).
These `Dockerfile`s define images that may be used when deploying services built with [Cro](http://cro.services/). They are based on the Debian `bullseye-slim` image, with build of Rakudo with only Cro's dependencies installed.

Until Cro version 0.8.7, images were built based on a Rakudo Star image, and hence shipped with many more modules. Beware that if you are upgrading from the Rakudo Star based images, you may well need to change your own `Dockerfile`s to install modules that Star bundled, but are no longer in these images.
53 changes: 53 additions & 0 deletions bullseye-rakudo-zef/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
### Dockerfile for building a minimal rakudo with zef

# use base image.
FROM debian:bullseye-slim AS build

# Author
MAINTAINER Nicholas Clark <nick@ccl4.org>

ARG rakudo_version=2021.10
ARG zef_version=v0.13.4
ARG prefix=/opt/rakudo

ARG keep="ca-certificates"
ARG build_only="build-essential git"

# The update-ca-certificates might be cargo-cult.
# Installing ca-certificates is not.

ENV PATH=${prefix}/share/perl6/site/bin:${prefix}/share/perl6/core/bin:${prefix}/bin:$PATH

RUN \
apt-get update && \
apt-get --yes --no-install-recommends install ${keep} ${build_only} && \
update-ca-certificates && \
git config --global advice.detachedHead false && \
tmpdir="$(mktemp -d)" && \
cd ${tmpdir} && \
git clone --depth=1 --shallow-submodules --branch ${rakudo_version} https://github.com/MoarVM/MoarVM && \
cd MoarVM && \
./Configure.pl --prefix=${prefix} && \
make -j3 install && \
tmpdir="$(mktemp -d)" && \
cd ${tmpdir} && \
git clone --depth=1 --shallow-submodules --branch ${rakudo_version} https://github.com/Raku/nqp && \
cd nqp && \
./Configure.pl --prefix=${prefix} && \
make -j3 test install && \
tmpdir="$(mktemp -d)" && \
cd ${tmpdir} && \
git clone --depth=1 --shallow-submodules --branch ${rakudo_version} https://github.com/rakudo/rakudo && \
cd rakudo && \
./Configure.pl --prefix=${prefix} && \
make -j3 test install HARNESS_TYPE=6 && \
tmpdir="$(mktemp -d)" && \
cd ${tmpdir} && \
git clone --depth=1 --branch ${zef_version} https://github.com/ugexe/zef && \
cd zef && \
rakudo -I. bin/zef install . && \
apt-get purge -y --auto-remove ${build_only} && \
rm -rf /var/lib/apt/lists/*

# Run when the container launches
CMD ["/opt/rakudo/bin/rakudo"]
8 changes: 6 additions & 2 deletions cro-core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM rakudo-star:2020.01
FROM bullseye-rakudo-zef:2021-10
MAINTAINER Jonathan Worthington <jonathan@edument.se>

ARG cro_version=0.8.7

RUN zef install 'Cro::Core:ver<'$cro_version'>'
RUN apt-get update && \
apt-get --yes --no-install-recommends install curl && \
zef install 'Cro::Core:ver<'$cro_version'>' && \
apt-get purge -y --auto-remove curl && \
rm -rf /var/lib/apt/lists/*
11 changes: 7 additions & 4 deletions cro-http-websocket/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM rakudo-star:2020.01
FROM bullseye-rakudo-zef:2021-10
MAINTAINER Jonathan Worthington <jonathan@edument.se>

ARG cro_version=0.8.7

ARG keep="libssl-dev"
ARG build_only="build-essential curl git"

RUN apt-get update && \
apt-get --yes --no-install-recommends install libssl-dev build-essential && \
zef upgrade OpenSSL && \
apt-get --yes --no-install-recommends install ${keep} ${build_only} && \
zef install OpenSSL && \
zef install 'Cro::Core:ver<'$cro_version'>' && \
zef install 'Cro::TLS:ver<'$cro_version'>' && \
zef install 'Cro::HTTP:ver<'$cro_version'>' && \
zef install 'Cro::WebSocket:ver<'$cro_version'>' && \
apt-get purge -y --auto-remove build-essential && \
apt-get purge -y --auto-remove ${build_only} && \
rm -rf /var/lib/apt/lists/*
14 changes: 9 additions & 5 deletions cro-http/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM rakudo-star:2020.01
FROM bullseye-rakudo-zef:2021-10
MAINTAINER Jonathan Worthington <jonathan@edument.se>

ARG cro_version=0.8.7

ARG keep="libssl-dev"
ARG build_only="curl git"

RUN apt-get update && \
apt-get --yes --no-install-recommends install libssl-dev && \
rm -rf /var/lib/apt/lists/* && \
zef upgrade OpenSSL && \
apt-get --yes --no-install-recommends install ${keep} ${build_only} && \
zef install OpenSSL && \
zef install 'Cro::Core:ver<'$cro_version'>' && \
zef install 'Cro::TLS:ver<'$cro_version'>' && \
zef install 'Cro::HTTP:ver<'$cro_version'>'
zef install 'Cro::HTTP:ver<'$cro_version'>' && \
apt-get purge -y --auto-remove ${build_only} && \
rm -rf /var/lib/apt/lists/*
11 changes: 6 additions & 5 deletions cro/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM rakudo-star:2020.01
FROM bullseye-rakudo-zef:2021-10
MAINTAINER Jonathan Worthington <jonathan@edument.se>

ARG cro_version=0.8.7
ARG keep="libssl-dev"
ARG build_only="build-essential curl git"

RUN apt-get update && \
apt-get --yes --no-install-recommends install libssl-dev build-essential && \
zef upgrade OpenSSL && \
apt-get --yes --no-install-recommends install ${keep} ${build_only} && \
zef install OpenSSL && \
zef install 'Cro::Core:ver<'$cro_version'>' && \
zef install 'Cro::TLS:ver<'$cro_version'>' && \
zef install 'Cro::HTTP:ver<'$cro_version'>' && \
zef install 'Cro::WebSocket:ver<'$cro_version'>' && \
zef install 'cro:ver<'$cro_version'>' && \
apt-get purge -y --auto-remove build-essential && \
apt-get purge -y --auto-remove ${build_only} && \
rm -rf /var/lib/apt/lists/*