From c2c90cd0345560db00e9ba68558f0900bd24a960 Mon Sep 17 00:00:00 2001 From: aptalca Date: Wed, 16 Jun 2021 17:34:25 -0400 Subject: [PATCH] standardize apt-get --- root/etc/cont-init.d/94-nodejs-src | 15 +++++++++++++++ root/etc/cont-init.d/95-apt-get | 3 +++ root/etc/cont-init.d/98-nodejs | 19 ++++--------------- 3 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 root/etc/cont-init.d/94-nodejs-src create mode 100644 root/etc/cont-init.d/95-apt-get diff --git a/root/etc/cont-init.d/94-nodejs-src b/root/etc/cont-init.d/94-nodejs-src new file mode 100644 index 0000000..0f4f3a9 --- /dev/null +++ b/root/etc/cont-init.d/94-nodejs-src @@ -0,0 +1,15 @@ +#!/usr/bin/with-contenv bash + +echo "**** installing nodejs dev environment ****" +if ! dpkg -l | grep gnupg > /dev/null; then + apt-get update && apt-get install -y gnupg +fi + +[[ ! -f "/etc/apt/sources.list.d/nodesource.list" ]] && \ + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ + echo 'deb https://deb.nodesource.com/node_12.x bionic main' \ + > /etc/apt/sources.list.d/nodesource.list +[[ ! -f "/etc/apt/sources.list.d/yarn.list" ]] && \ + curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo 'deb https://dl.yarnpkg.com/debian/ stable main' \ + > /etc/apt/sources.list.d/yarn.list 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-nodejs b/root/etc/cont-init.d/98-nodejs index fac3c8d..a0524da 100644 --- a/root/etc/cont-init.d/98-nodejs +++ b/root/etc/cont-init.d/98-nodejs @@ -1,17 +1,6 @@ #!/usr/bin/with-contenv bash -echo "**** installing nodejs dev environment ****" -if ! dpkg -l | grep gnupg > /dev/null; then - apt-get update && apt-get install -y gnupg -fi -[[ ! -f "/etc/apt/sources.list.d/nodesource.list" ]] && \ - curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ - echo 'deb https://deb.nodesource.com/node_12.x bionic main' \ - > /etc/apt/sources.list.d/nodesource.list -[[ ! -f "/etc/apt/sources.list.d/yarn.list" ]] && \ - curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ - echo 'deb https://dl.yarnpkg.com/debian/ stable main' \ - > /etc/apt/sources.list.d/yarn.list -apt-get update && apt-get install -y \ - nodejs \ - yarn +echo "**** Installing nodejs and yarn" +apt-get install -y \ + nodejs \ + yarn