Skip to content

Fix fedora security updating #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 35 additions & 8 deletions release/preview/fedora/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,48 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
# Install dependencies and clean up
RUN curl -sSL ${PS_PACKAGE_URL} -o /tmp/powershell.rpm \
&& dnf install -y /tmp/powershell.rpm \
# remove powershell package
&& rm /tmp/powershell.rpm \
&& dnf install -y \
# less is needed for help
less \
less \
# Needed to run localdef
glibc-locale-source \
glibc-locale-source \
# Invoke-WebRequest doesn't work correctly without this
compat-openssl10 \
ca-certificates \
gssntlmssp \
compat-openssl10 \
ca-certificates \
gssntlmssp \
&& ln -sf /opt/microsoft/powershell/7-preview/pwsh /usr/bin/pwsh \
# For whatever reason FEDORA-2019-27e7b92407 has to be patched manually
# to do this, upgrade libmodulemd1, if it is installed
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
\$module = (dnf list installed libmodulemd1 | Select-String -SimpleMatch libmodulemd1); \
if(\$module) { \
dnf upgrade -y libmodulemd1 \
}" \
# This installs most security advisories
&& dnf upgrade-minimal -y --security \
# query and install any remaining security advisories
&& pwsh \
-NoLogo \
-NoProfile \
-Command " \
(dnf updateinfo list -q --security) | \
Foreach-Object { \
\$advisory=(\$_ -split ' ')[0]; \
Write-Host '******* Patching *********'; \
Write-Host \$advisory; \
Write-Host '************************'; \
dnf upgrade -y --advisory=\$advisory \
}" \
&& echo "verifying all security advisories are installed..." \
&& dnf updateinfo list -q --security \
&& echo "end - verifying all security advisories are installed..." \
&& dnf clean all \
&& localedef --charmap=UTF-8 --inputfile=en_US $LANG \
# remove powershell package
&& rm /tmp/powershell.rpm \
&& ln -sf /opt/microsoft/powershell/7-preview/pwsh /usr/bin/pwsh \
# intialize powershell module cache
&& pwsh \
-NoLogo \
Expand Down