fix(docs-infra): update (and unpin) dependency versions for preview server (#45390)

Update the `Dockerfile` used to create the preview server to use the
latest stable version of Debian (`bullseye`) and also update package
versions to latest versions.

Also, unpin the versions of installed packages (except for Node.js
related ones) as pinning proved problematic due to many packages
removing old versions from the official repositories.

NOTE:
This change will allow the preview server to be updated on the VM and
take advantage of recent fixes, such as #45349. Currently, the update
fails with the error:
```
E: Version '7.64.0-4+deb10u1' for 'curl' was not found
The command '/bin/sh -c apt-get update -y && apt-get install -y curl=7.64.0-4+deb10u1' returned a non-zero code: 100
```

PR Close #45390
This commit is contained in:
George Kalpakas
2022-03-18 21:47:16 +02:00
committed by Dylan Hunn
parent f19b36f462
commit f671dd5815
+13 -13
View File
@@ -1,5 +1,5 @@
# Image metadata and config # Image metadata and config
FROM debian:buster FROM debian:bullseye
LABEL name="angular.io PR preview" \ LABEL name="angular.io PR preview" \
description="This image implements the PR preview functionality for angular.io." \ description="This image implements the PR preview functionality for angular.io." \
@@ -72,29 +72,29 @@ RUN mkdir /var/log/aio
# Add extra package sources # Add extra package sources
RUN apt-get update -y && apt-get install -y curl=7.64.0-4+deb10u1 RUN apt-get update -y && apt-get install -y curl
RUN curl --silent --show-error --location https://deb.nodesource.com/setup_12.x | bash - RUN curl --silent --show-error --location https://deb.nodesource.com/setup_14.x | bash -
RUN curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# Install packages # Install packages
# NOTE: Some packages (such as `nginx`, `nodejs`, `openssl`) make older versions unavailable on the # NOTE: Many packages make older versions unavailable on the repositories, so we cannot pin to
# repositories, so we cannot pin to specific versions for these packages :( # specific versions :(
# See for example: # See, for example:
# - https://github.com/nodesource/distributions/issues/33 # - https://github.com/nodesource/distributions/issues/33
# - https://askubuntu.com/questions/715104/how-can-i-downgrade-openssl-via-apt-get # - https://askubuntu.com/questions/715104/how-can-i-downgrade-openssl-via-apt-get
RUN apt-get update -y && apt-get install -y \ RUN apt-get update -y && apt-get install -y \
cron=3.0pl1-134+deb10u1 \ cron \
dnsmasq=2.80-1 \ dnsmasq \
nano=3.2-3 \ nano \
nginx \ nginx \
nodejs \ nodejs \
openssl \ openssl \
rsyslog=8.1901.0-1 \ rsyslog \
vim=2:8.1.0875-5 \ vim \
yarn=1.22.4-1 yarn=1.22.18-1
RUN yarn global add pm2@4.4.0 RUN yarn global add pm2@5.2.0
# Set up log rotation # Set up log rotation