mirror of
https://github.com/pi-hole/pi-hole.git
synced 2026-05-29 11:19:14 +02:00
551b6516d1
Add ARG declarations and a build-time RUN step to all Dockerfiles so bats-core, bats-support, bats-assert, bats-mock, and bats-file are cloned at image build time rather than at container runtime. Library versions are defined once in run.sh and passed down via --build-arg Add .dockerignore to exclude any locally-cached test/libs/ directory from the build context, preventing 'destination already exists' failures when the directory exists from a previous local test run. Remove the legacy commented-out sed stub command from all Dockerfiles Signed-off-by: Adam Warner <me@adamwarner.co.uk>
28 lines
1.2 KiB
Docker
28 lines
1.2 KiB
Docker
FROM fedora:43
|
|
RUN dnf install -y git initscripts
|
|
|
|
ENV GITDIR=/etc/.pihole
|
|
ENV SCRIPTDIR=/opt/pihole
|
|
|
|
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
|
|
ADD . $GITDIR
|
|
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
|
|
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
|
|
|
|
RUN true && \
|
|
chmod +x $SCRIPTDIR/*
|
|
|
|
ARG BATS_CORE_VER
|
|
ARG BATS_SUPPORT_VER
|
|
ARG BATS_ASSERT_VER
|
|
ARG BATS_MOCK_VER
|
|
ARG BATS_FILE_VER
|
|
RUN git clone --depth=1 --single-branch --branch "${BATS_CORE_VER}" https://github.com/bats-core/bats-core $GITDIR/test/libs/bats && \
|
|
git clone --depth=1 --single-branch --branch "${BATS_SUPPORT_VER}" https://github.com/bats-core/bats-support $GITDIR/test/libs/bats-support && \
|
|
git clone --depth=1 --single-branch --branch "${BATS_ASSERT_VER}" https://github.com/bats-core/bats-assert $GITDIR/test/libs/bats-assert && \
|
|
git clone --depth=1 --single-branch --branch "${BATS_MOCK_VER}" https://github.com/jasonkarns/bats-mock $GITDIR/test/libs/bats-mock && \
|
|
git clone --depth=1 --single-branch --branch "${BATS_FILE_VER}" https://github.com/bats-core/bats-file $GITDIR/test/libs/bats-file
|
|
|
|
ENV SKIP_INSTALL=true
|
|
|