From 4cb41ff9f3978bf703366cd7b28043ca3d1579c3 Mon Sep 17 00:00:00 2001 From: aptalca Date: Wed, 16 Jun 2021 17:47:28 -0400 Subject: [PATCH] standardize apt-get --- root/etc/cont-init.d/94-php8-src | 10 ++++++++++ root/etc/cont-init.d/95-apt-get | 3 +++ root/etc/cont-init.d/98-php8 | 12 ++---------- 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 root/etc/cont-init.d/94-php8-src create mode 100644 root/etc/cont-init.d/95-apt-get diff --git a/root/etc/cont-init.d/94-php8-src b/root/etc/cont-init.d/94-php8-src new file mode 100644 index 0000000..b573a1e --- /dev/null +++ b/root/etc/cont-init.d/94-php8-src @@ -0,0 +1,10 @@ +#!/usr/bin/with-contenv bash + +ppa="ppa:ondrej/php" +if ! grep -q "^deb .*${ppa}" /etc/apt/sources.list /etc/apt/sources.list.d/*; then + echo "**** adding ppa ondrej/php ****" + if ! dpkg -l | grep software-properties-common > /dev/null; then + apt-get update && apt-get install -y software-properties-common + fi + add-apt-repository ${ppa} -y +fi diff --git a/root/etc/cont-init.d/95-apt-get b/root/etc/cont-init.d/95-apt-get new file mode 100644 index 0000000..3a725ea --- /dev/null +++ b/root/etc/cont-init.d/95-apt-get @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash + +apt-get update \ No newline at end of file diff --git a/root/etc/cont-init.d/98-php8 b/root/etc/cont-init.d/98-php8 index bdce2f5..da6bd20 100644 --- a/root/etc/cont-init.d/98-php8 +++ b/root/etc/cont-init.d/98-php8 @@ -1,14 +1,6 @@ #!/usr/bin/with-contenv bash -echo "**** adding ppa ondrej/php ****" -apt-get update && apt-get install -y \ - software-properties-common -ppa="ppa:ondrej/php" -if ! grep -q "^deb .*${ppa}" /etc/apt/sources.list /etc/apt/sources.list.d/*; then - add-apt-repository ${ppa} -y -fi - -echo "**** installing php and composer ****" -apt-get update && apt-get install -y \ +echo "**** installing php8 and composer ****" +apt-get install -y \ composer \ php8.0 \ No newline at end of file