Skip to content

Commit

Permalink
Move gnupg installation to Dockerfile
Browse files Browse the repository at this point in the history
We use gnupg for apt key verification so we should install it once to
allow further streamlining of the build process.

We currently install it and remove it multiple times, and because it is
not a part of the base build, we have to do additional apt processes
just to install it before we add custom repos.
  • Loading branch information
andrewnicols committed Mar 15, 2023
1 parent 1593ce6 commit 54a767e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN echo "Building for ${TARGETPLATFORM}"

# Install some packages that are useful within the images.
RUN apt-get update && apt-get install -y \
git \
git gnupg \
&& rm -rf /var/lib/apt/lists/*

# Install pickle as an easier alternative to PECL, that is not
Expand Down
2 changes: 1 addition & 1 deletion root/tmp/setup/php-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
echo "Installing apt dependencies"

# Build packages will be added during the build, but will be removed at the end.
BUILD_PACKAGES="gettext gnupg libcurl4-openssl-dev libfreetype6-dev libicu-dev libjpeg62-turbo-dev \
BUILD_PACKAGES="gettext libcurl4-openssl-dev libfreetype6-dev libicu-dev libjpeg62-turbo-dev \
libldap2-dev libmariadb-dev libmemcached-dev libpng-dev libpq-dev libxml2-dev libxslt-dev \
unixodbc-dev uuid-dev"

Expand Down
13 changes: 6 additions & 7 deletions root/tmp/setup/sqlsrv-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@ if [[ ${TARGETPLATFORM} != "linux/amd64" ]]; then
fi

# Packages for build.
BUILD_PACKAGES="gnupg unixodbc-dev"
BUILD_PACKAGES="unixodbc-dev"

# Packages for sqlsrv runtime.
PACKAGES_SQLSRV="unixodbc"

echo "Installing apt dependencies"
apt-get update
apt-get install -y --no-install-recommends apt-transport-https \
$BUILD_PACKAGES \
$PACKAGES_SQLSRV

# Install Microsoft dependencies for sqlsrv
echo "Downloading sqlsrv files"
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
# TODO, bullseye should be 11, but the msodbcsql17 package is not available yet, hence using buster (10) one.
curl https://packages.microsoft.com/config/debian/10/prod.list -o /etc/apt/sources.list.d/mssql-release.list
apt-get update

echo "Installing apt dependencies"
apt-get install -y --no-install-recommends apt-transport-https \
$BUILD_PACKAGES \
$PACKAGES_SQLSRV

echo "Install msodbcsql"
ACCEPT_EULA=Y apt-get install -y msodbcsql17

Expand Down

0 comments on commit 54a767e

Please sign in to comment.