From d84a3b7e6eeeff385fad325f752f377b86bc4db3 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Fri, 4 Nov 2022 11:50:01 +0100 Subject: [PATCH] add individual install scripts --- Dockerfile | 20 +++----------------- install/install-dotnet.sh | 12 ++++++++++++ install/install-golang.sh | 19 +++++++++++++++++++ install/install-nodejs.sh | 17 +++++++++++++++++ install/install-powershell.sh | 21 +++++++++++++++++++++ 5 files changed, 72 insertions(+), 17 deletions(-) create mode 100644 install/install-dotnet.sh create mode 100644 install/install-golang.sh create mode 100644 install/install-nodejs.sh create mode 100644 install/install-powershell.sh diff --git a/Dockerfile b/Dockerfile index 574faf6..3462c4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,21 +14,7 @@ RUN \ git config --system credential.helper store && \ echo 'source /usr/share/bash-completion/completions/git' >> /etc/bash.bashrc -#RUN \ -# echo "**** install dev runtimes ****" && \ -# curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \ -# apt-get install --no-install-recommends -y \ -# nodejs \ -# golang-go - -#RUN \ -# echo "**** clean up ****" && \ -# apt-get clean && \ -# rm -rf \ -# /tmp/* \ -# /var/lib/apt/lists/* \ -# /var/tmp/* - -ADD finalize-codeserver.sh /usr/bin/ +ADD install/install* /usr/bin/ RUN \ - chmod +x /usr/bin/finalize-codeserver.sh + chmod +x /usr/bin/install-* && \ + echo "Install required dev runtimes with the 'install-*' scripts." >> /etc/bashrc diff --git a/install/install-dotnet.sh b/install/install-dotnet.sh new file mode 100644 index 0000000..4a3c3e9 --- /dev/null +++ b/install/install-dotnet.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +echo "**** downloading latest install script ****" +curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh +chmod +x /tmp/dotnet-install.sh + +echo "**** installing latest .NET Core LTS release ****" +/tmp/dotnet-install.sh --channel LTS +echo 'export PATH=$PATH:/config/.dotnet' | sudo tee -a /etc/bash.bashrc > /dev/null + +echo "**** done. ****" diff --git a/install/install-golang.sh b/install/install-golang.sh new file mode 100644 index 0000000..f761b77 --- /dev/null +++ b/install/install-golang.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e +if [[ -z "$1" ]] +then + GOVERSION="1.19.3" +else + GOVERSION="$1" +fi + +echo "**** downloading golang ($GOVERSION)****" +curl -fsSL "https://go.dev/dl/go$GOVERSION.linux-amd64.tar.gz" -o /tmp/golang.tar.gz +echo "**** installing golang ($GOVERSION)****" +sudo rm -rf /usr/local/go +sudo tar -C /usr/local -xzf /tmp/golang.tar.gz +echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/bash.bashrc > /dev/null +echo "**** cleaning up ****" +rm -f /tmp/golang.tar.gz +echo "**** done. ****" +echo "**** please reload bashprofile to finalize ****" diff --git a/install/install-nodejs.sh b/install/install-nodejs.sh new file mode 100644 index 0000000..5b659df --- /dev/null +++ b/install/install-nodejs.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +echo "**** adding nodesource package source (NodeJS LTS) ****" +curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - +echo "**** updating package lists + installing NodeJS LTS ****" +sudo apt-get install --no-install-recommends -y \ + nodejs + +echo "**** cleaning up ****" +sudo apt-get clean +sudo rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* + +echo "**** done. ****" diff --git a/install/install-powershell.sh b/install/install-powershell.sh new file mode 100644 index 0000000..a89ca41 --- /dev/null +++ b/install/install-powershell.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +echo "**** installing powershell requirements ****" +sudo apt-get install --no-install-recommends -y \ + apt-transport-https \ + software-properties-common + +echo "**** adding powershell package sources ****" +# Download the Microsoft repository GPG keys +curl -fsSL "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" -o /tmp/packages-microsoft-prod.deb +# Register the Microsoft repository GPG keys +sudo dpkg -i /tmp/packages-microsoft-prod.deb +# Update the list of packages after we added packages.microsoft.com +sudo apt-get update +echo "**** installing powershell ****" +# Install PowerShell +sudo apt-get install --no-install-recommends -y powershell +echo "**** done. ****" +# Start PowerShell +#pwsh