Skip to content
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
2 changes: 1 addition & 1 deletion docker/jobs/knative-job-service.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE=node
ARG BASE_VERSION=20-bookworm
ARG BASE_VERSION=22-bookworm

FROM ${BASE}:${BASE_VERSION} AS build

Expand Down
66 changes: 32 additions & 34 deletions docker/node-sqitch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE=node
ARG BASE_VERSION=20.12.0-alpine3.19
ARG BASE_VERSION=22-bookworm
FROM ${BASE}:${BASE_VERSION} AS sqitch-build

LABEL org.opencontainers.image.source="https://github.com/constructive-io/constructive"
Expand All @@ -8,29 +8,32 @@ LABEL org.opencontainers.image.source="https://github.com/constructive-io/constr
WORKDIR /work
ARG VERSION=1.1.0
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
&& apk add --no-cache --virtual .build-deps \
alpine-sdk \
perl-dev \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
postgresql-dev \
perl-dbd-pg \
tzdata \
gnupg \
&& apk add --no-cache perl \
libdbd-pg-perl \
libperl-dev \
libpq-dev \
perl \
tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& curl -LO https://www.cpan.org/authors/id/D/DW/DWHEELER/App-Sqitch-v$VERSION.tar.gz \
&& mkdir src \
&& tar -zxf App-Sqitch-v$VERSION.tar.gz --strip-components 1 -C src

# Install cpan and build dependencies.
ENV PERL5LIB /work/local/lib/perl5
ENV PERL5LIB=/work/local/lib/perl5
RUN curl -sL --compressed https://git.io/cpm > cpm && chmod +x cpm \
&& ./cpm install -L local --verbose --no-test ExtUtils::MakeMaker \
&& ./cpm install -L local --verbose --no-test --with-recommends \
--with-configure --cpanfile src/dist/cpanfile
--with-configure --without-develop --cpanfile src/dist/cpanfile

ENV TZ UTC
RUN cp /usr/share/zoneinfo/UTC /etc/localtime && \
echo UTC > /etc/timezone
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime \
&& echo UTC > /etc/timezone

# Build, test, bundle, prune.
WORKDIR /work/src
Expand All @@ -44,49 +47,44 @@ RUN perl Build.PL --quiet --install_base /app --etcdir /etc/sqitch \
&& rm -rf /app/man \
&& find /app -name '*.pod' | grep -v sqitch | xargs rm -rf

RUN apk del .build-deps

################################################################################
# Copy to the final image without all the build stuff.

ARG BASE=node
ARG BASE_VERSION=20.12.0-alpine3.19
ARG BASE_VERSION=22-bookworm
FROM ${BASE}:${BASE_VERSION} AS sqitch

LABEL org.opencontainers.image.source="https://github.com/constructive-io/constructive"

# Install runtime system dependencies and remove unnecesary files.
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
&& apk add --no-cache --virtual .build-deps2 \
# perl \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
ca-certificates \
# libpq5 \
# postgresql-client \
&& apk add --no-cache \
g++ \
git \
less \
libdbd-pg-perl \
make \
perl \
postgresql-client \
# ca-certificates \
# libpq5 \
python3-dev \
vim-tiny \
&& mkdir -p /etc/pki/tls && ln -s /etc/ssl/certs /etc/pki/tls/ \
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/* /usr/bin/mysql?* \
&& rm -rf /plibs /man /usr/share/man /usr/share/doc /usr/share/postgresql \
/usr/share/nano /etc/nanorc \
&& find / -name '*.pod' | grep -v sqitch | xargs rm -rf \
&& find / -name '*.ph' -delete \
&& find / -name '*.h' -delete
&& find / -name '*.pod' | grep -v sqitch | xargs rm -rf

# Copy the app and config from the build image.
COPY --from=sqitch-build /app .
COPY --from=sqitch-build /app /opt/sqitch/
COPY --from=sqitch-build /etc/sqitch /etc/sqitch/
COPY --from=sqitch-build /etc/localtime /etc/localtime
COPY --from=sqitch-build /etc/timezone /etc/timezone

RUN apk del .build-deps2
COPY --from=sqitch-build /etc/localtime /etc/localtime
COPY --from=sqitch-build /etc/timezone /etc/timezone

# Set up environment, entrypoint, and default command.
ENV PATH=/opt/sqitch/bin:$PATH PERL5LIB=/opt/sqitch/lib/perl5
ENV LESS=-R LC_ALL=C.UTF-8 LANG=C.UTF-8 SQITCH_EDITOR=vi SQITCH_PAGER=less

# for gyp and such
RUN apk update && apk add --no-cache bash git python3-dev make g++

ENTRYPOINT ["/bin/sh"]
2 changes: 1 addition & 1 deletion docker/node-sqitch/version.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
base: node
versions:
- 20.12.0-alpine3.19
- 22-bookworm
Loading