diff --git a/Dockerfile b/Dockerfile index 2866da694..bfe0a6cba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,10 +53,9 @@ RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless # install bats ARG BATS_VERSION RUN cd /tmp \ - && git clone https://github.com/bats-core/bats-core.git \ + && git clone --depth 1 --branch "${BATS_VERSION}" https://github.com/bats-core/bats-core.git \ && cd bats-core \ - && git reset --hard "${BATS_VERSION}" \ - && ./install.sh /usr/local \ + && ./install.sh /usr \ && rm -rf /tmp/bats-core ARG RELEASE_ARCHES="386 amd64 arm64 armel armhf ppc64le riscv64 s390x" diff --git a/script/setup_host.sh b/script/setup_host.sh index 9cd317d2c..b0a8ba030 100755 --- a/script/setup_host.sh +++ b/script/setup_host.sh @@ -55,23 +55,9 @@ fi # Install BATS if [ "$PLATFORM_ID" = "platform:el8" ]; then # The packaged version of bats is too old: `BATS_ERROR_SUFFIX: unbound variable`, `bats_require_minimum_version: command not found` - ( - cd /tmp - git clone https://github.com/bats-core/bats-core - ( - cd bats-core - git checkout "$BATS_VERSION" - ./install.sh /usr/local - cat >>/etc/profile.d/sh.local <<'EOF' -PATH="/usr/local/bin:$PATH" -export PATH -EOF - cat >/etc/sudoers.d/local <<'EOF' -Defaults secure_path = "/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" -EOF - ) - rm -rf bats-core - ) + git clone --depth 1 --branch "$BATS_VERSION" https://github.com/bats-core/bats-core /tmp/bats-core + /tmp/bats-core/install.sh /usr + rm -rf /tmp/bats-core else "${DNF[@]}" install bats fi