1
0
Fork 0
mirror of https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git synced 2024-11-21 21:30:11 +00:00

Use pipe fail, quote array expansion and prevent word globbing

This commit is contained in:
Fred Clausen 2024-06-01 10:10:11 -06:00
parent cf7535f8e9
commit 44637143f6
No known key found for this signature in database
GPG key ID: F406B080289FEC21

View file

@ -6,8 +6,8 @@ ENV URL_MLAT_CLIENT_REPO="https://github.com/wiedehopf/mlat-client.git" \
PRIVATE_MLAT="false" \ PRIVATE_MLAT="false" \
MLAT_INPUT_TYPE="auto" MLAT_INPUT_TYPE="auto"
RUN set -x && \ SHELL ["/bin/bash", "-o", "pipefail", "-x"]
TEMP_PACKAGES=() && \ RUN TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \ KEPT_PACKAGES=() && \
# Git and net-tools are needed to install and run @Mikenye's HealthCheck framework # Git and net-tools are needed to install and run @Mikenye's HealthCheck framework
KEPT_PACKAGES+=(git) && \ KEPT_PACKAGES+=(git) && \
@ -31,8 +31,8 @@ RUN set -x && \
# Install all these packages: # Install all these packages:
apt-get update -q -y && \ apt-get update -q -y && \
apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \ apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
${KEPT_PACKAGES[@]} \ "${KEPT_PACKAGES[@]}" \
${TEMP_PACKAGES[@]} && \ "${TEMP_PACKAGES[@]}" && \
# #
# Compile and Install the mlat_client # Compile and Install the mlat_client
mkdir -p /git && \ mkdir -p /git && \
@ -45,7 +45,7 @@ RUN set -x && \
rm -rf /git && \ rm -rf /git && \
# #
# Clean up and install POST_PACKAGES: # Clean up and install POST_PACKAGES:
apt-get remove -q -y ${TEMP_PACKAGES[@]} && \ apt-get remove -q -y "${TEMP_PACKAGES[@]}" && \
# apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \ # apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -q \
# ${POST_PACKAGES[@]} && \ # ${POST_PACKAGES[@]} && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \ apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
@ -63,7 +63,7 @@ COPY rootfs/ /
RUN set -x && \ RUN set -x && \
branch="##BRANCH##" && \ branch="##BRANCH##" && \
[[ "${branch:0:1}" == "#" ]] && branch="main" || true && \ [[ "${branch:0:1}" == "#" ]] && branch="main" || true && \
git clone --depth=1 -b $branch https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git /tmp/clone && \ git clone --depth=1 -b "$branch" https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git /tmp/clone && \
pushd /tmp/clone && \ pushd /tmp/clone && \
echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(git rev-parse --short HEAD)_$(git branch --show-current)" > /.CONTAINER_VERSION && \ echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(git rev-parse --short HEAD)_$(git branch --show-current)" > /.CONTAINER_VERSION && \
popd && \ popd && \