# syntax = docker/dockerfile:experimental # # Requires Docker v18.06 or later and BuildKit mode to use cache mount # Docker v18.06 also requires the daemon to be running in experimental mode. # # $ DOCKER_BUILDKIT=1 docker build . # # See https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md FROM registry.gitlab.com/pld-linux/pld AS base FROM base AS dist WORKDIR /dist COPY rpmmacros ./home/builder/.rpmmacros # overwrite with our config (it defines same path, but disabled) COPY localrpms.conf ./etc/poldek/source.conf COPY sudoers ./etc/sudoers.d/builder # use sane permissions until solved upstream # https://gitlab.com/gitlab-org/gitlab-runner/issues/1736 RUN chmod -R a+rX,og-w . FROM base RUN --mount=type=cache,id=poldek,target=/var/cache/poldek \ set -x \ # enable to preserve downloaded packages && poldek-config keep_downloads yes \ # disable mixed php versions # remove current php flavor from exclude list && PHP_VERSION=5.3 \ && IGNORE_PACKAGES="systemd-init *php4* *php52* *php53* *php54* *php55* *php56* *php70* *php71* *php72* *php73* *php74* *php80* *php81* *php82**" \ && IGNORE_PACKAGES=$(echo "$IGNORE_PACKAGES" | sed -e "s/ \*php${PHP_VERSION/./}\*//") \ && poldek-config ignore "$IGNORE_PACKAGES" \ # first upgrade to latest && poldek --up --upgrade-dist \ # install build deps && poldek -u \ binutils \ ca-certificates \ ccache-wrapper \ coreutils \ findutils \ gawk \ git-core \ perl-modules \ rpm-build \ rpm-getdeps \ sudo \ util-linux \ # this will setup builder user && poldek -u pld-builder-chroot \ # useless, as it configures empty dir && rm /etc/poldek/repos.d/pld-builder.conf \ && exit 0 COPY --from=dist /dist / # switch user USER builder WORKDIR /home/builder # Use sleep to run forever CMD ["sleep", "infinity"]