Skip to content

Commit

Permalink
feat(dockerfile.*): remove Jinja2 downgrade workaround where possible
Browse files Browse the repository at this point in the history
Fix has been released:

* saltstack/salt#60811

Maintain Jinja2 downgrades where necessary, as outlined here:

* saltstack/salt#60811 (comment)
  • Loading branch information
myii committed Sep 2, 2021
1 parent 3529c9b commit 07a0d03
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
5 changes: 0 additions & 5 deletions Dockerfile.apt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ RUN apt-get update \
apt-get update; \
apt-get install --yes --no-install-recommends salt-minion; \
fi \
# Use temporary workaround of downgrading Jinja2 for images built using `git`
# See https://github.com/saltstack/salt/issues/60188
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${PYTHON_VERSION}" = "3" ]; then \
pip3 install --no-cache-dir Jinja2==2.11.3; \
fi \
# Disable salt's service as we don't need it running
&& systemctl disable salt-minion.service > /dev/null 2>&1 \
# Remove unnecessary getty and udev targets that result in high CPU usage when using
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dnf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN dnf -y update && dnf -y install ${PKGS} --setopt=install_weak_deps=False &&
sh -s -- -XUdfPD -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION \
# Use temporary workaround of downgrading Jinja2 for images built using `git`
# See https://github.com/saltstack/salt/issues/60188
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${PYTHON_VERSION}" = "3" ]; then \
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${SALT_VERSION}" != "master" ]; then \
pip3 install --no-cache-dir Jinja2==2.11.3; \
fi \
&& systemctl disable salt-minion.service > /dev/null 2>&1 \
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.emg
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ RUN mkdir --parents /etc/portage/repos.conf \
# Use temporary workaround of downgrading Jinja2 for images built using `git`
# See https://github.com/saltstack/salt/issues/60188
# Now required on most `stable` images as well and already at `2.11.3` on the rest,
# so install without a conditional
&& pip3 install --no-cache-dir --prefix=/usr Jinja2==2.11.3 \
# so install for all except `master` builds
&& if [ "${SALT_VERSION}" != "master" ]; then \
pip3 install --no-cache-dir --prefix=/usr Jinja2==2.11.3; \
fi \
# Generate locales
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen \
# Enable sshd and disable salt's service as we don't need it running
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.pac
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ RUN pacman --noconfirm -Sy archlinux-keyring \
sh -s -- -XUdfPD -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION \
# Use temporary workaround of downgrading Jinja2 for images built using `git`
# See https://github.com/saltstack/salt/issues/60188
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${PYTHON_VERSION}" = "3" ]; then \
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${SALT_VERSION}" != "master" ]; then \
pip3 install --no-cache-dir Jinja2==2.11.3; \
else \
elif [ "${SALT_INSTALL_METHOD}" = "stable" ]; then \
pacman --noconfirm -U https://archive.archlinux.org/packages/p/python-jinja/python-jinja-2.11.3-2-any.pkg.tar.zst; \
fi \
&& systemctl enable sshd \
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile.yum
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ RUN if [[ "${DISTRO_NAME}" = "centos" ]]; then \
yum clean expire-cache; \
yum -y install salt-minion; \
fi \
# Use temporary workaround of downgrading Jinja2 for images built using `git`
# See https://github.com/saltstack/salt/issues/60188
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${PYTHON_VERSION}" = "3" ]; then \
pip3 install --no-cache-dir Jinja2==2.11.3; \
fi \
&& if command -v systemctl; then \
systemctl disable salt-minion.service > /dev/null 2>&1; \
elif [ -f "/etc/init.d/salt-minion" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.zyp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN zypper refresh && zypper install --no-recommends -y ${PKGS} && zypper clean
sh -s -- -XUdfPwD -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION \
# Use temporary workaround of downgrading Jinja2 for images built using `git`
# See https://github.com/saltstack/salt/issues/60188
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${PYTHON_VERSION}" = "3" ]; then \
&& if [ "${SALT_INSTALL_METHOD}" = "git" ] && [ "${SALT_VERSION}" != "master" ]; then \
pip3 install --no-cache-dir Jinja2==2.11.3; \
elif [ "${SALT_INSTALL_METHOD}" = "stable" ] && [ "${DISTRO_NAME}" = "opensuse/tumbleweed" ]; then \
JINJA2_PKG_NAME=python38-Jinja2-2.11.3-1.4.x86_64.rpm; \
Expand Down

0 comments on commit 07a0d03

Please sign in to comment.