diff --git a/docker/jobs/knative-job-service.Dockerfile b/docker/jobs/knative-job-service.Dockerfile index b9a8ce5901..e23a5fa7c6 100644 --- a/docker/jobs/knative-job-service.Dockerfile +++ b/docker/jobs/knative-job-service.Dockerfile @@ -1,5 +1,5 @@ ARG BASE=node -ARG BASE_VERSION=20-bookworm +ARG BASE_VERSION=22-bookworm FROM ${BASE}:${BASE_VERSION} AS build diff --git a/docker/node-sqitch/Dockerfile b/docker/node-sqitch/Dockerfile index cea8523f04..6b53126087 100644 --- a/docker/node-sqitch/Dockerfile +++ b/docker/node-sqitch/Dockerfile @@ -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" @@ -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 @@ -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"] diff --git a/docker/node-sqitch/version.yaml b/docker/node-sqitch/version.yaml index 5cceb380ae..12482b69cc 100644 --- a/docker/node-sqitch/version.yaml +++ b/docker/node-sqitch/version.yaml @@ -1,3 +1,3 @@ base: node versions: -- 20.12.0-alpine3.19 +- 22-bookworm