From 27600c410ed96715ce3086cfa389c29688493cbe Mon Sep 17 00:00:00 2001 From: Krystan Honour Date: Fri, 7 Jun 2019 16:23:02 +0100 Subject: [PATCH 01/19] refactor file to take better account of layers. --- .../.devcontainer/Dockerfile | 31 ++++++------------- .../.devcontainer/Dockerfile | 30 ++++++------------ 2 files changed, 20 insertions(+), 41 deletions(-) diff --git a/containers/javascript-node-lts/.devcontainer/Dockerfile b/containers/javascript-node-lts/.devcontainer/Dockerfile index a9faaa3afe..4c26e27f87 100644 --- a/containers/javascript-node-lts/.devcontainer/Dockerfile +++ b/containers/javascript-node-lts/.devcontainer/Dockerfile @@ -5,33 +5,22 @@ FROM node:lts -# Configure apt ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Verify git and needed tools are installed -RUN apt-get install -y git procps +ENV DEBIAN_FRONTEND=dialog +ENV SHELL /bin/bash -# Remove outdated yarn from /opt and install via package -# so it can be easily updated via apt-get upgrade yarn -RUN rm -rf /opt/yarn-* \ +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + && apt-get install -y git procps \ + && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ && apt-get install -y curl apt-transport-https lsb-release \ && curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ - && apt-get -y install --no-install-recommends yarn - -# Install eslint -RUN npm install -g eslint - -# Clean up -RUN apt-get autoremove -y \ + && apt-get -y install --no-install-recommends yarn \ + && npm install -g eslint \ + && apt-get autoremove -y \ && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog - -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file + && rm -rf /var/lib/apt/lists/* \ diff --git a/containers/typescript-node-8/.devcontainer/Dockerfile b/containers/typescript-node-8/.devcontainer/Dockerfile index 46a3bd5a8b..138b98993a 100644 --- a/containers/typescript-node-8/.devcontainer/Dockerfile +++ b/containers/typescript-node-8/.devcontainer/Dockerfile @@ -7,31 +7,21 @@ FROM node:8 # Configure apt ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Verify git and needed tools are installed -RUN apt-get install -y git procps +ENV DEBIAN_FRONTEND=dialog +ENV SHELL /bin/bash -# Remove outdated yarn from /opt and install via package -# so it can be easily updated via apt-get upgrade yarn -RUN rm -rf /opt/yarn-* \ +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + && apt-get install -y git procps \ + && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ && apt-get install -y curl apt-transport-https lsb-release \ && curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ - && apt-get -y install --no-install-recommends yarn - -# Install tslint and typescript -RUN npm install -g tslint typescript - -# Clean up -RUN apt-get autoremove -y \ + && apt-get -y install --no-install-recommends yarn \ + && npm install -g tslint typescript \ + && apt-get autoremove -y \ && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog - -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file + && rm -rf /var/lib/apt/lists/* \ No newline at end of file From 084809623d0aa79f8ceec99f797f9ab9fa1fdb51 Mon Sep 17 00:00:00 2001 From: Krystan Honour Date: Fri, 7 Jun 2019 17:06:11 +0100 Subject: [PATCH 02/19] moved front end to the end where it should be --- containers/typescript-node-8/.devcontainer/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/containers/typescript-node-8/.devcontainer/Dockerfile b/containers/typescript-node-8/.devcontainer/Dockerfile index 138b98993a..670d5a6232 100644 --- a/containers/typescript-node-8/.devcontainer/Dockerfile +++ b/containers/typescript-node-8/.devcontainer/Dockerfile @@ -7,7 +7,6 @@ FROM node:8 # Configure apt ENV DEBIAN_FRONTEND=noninteractive -ENV DEBIAN_FRONTEND=dialog ENV SHELL /bin/bash RUN apt-get update \ @@ -24,4 +23,6 @@ RUN apt-get update \ && npm install -g tslint typescript \ && apt-get autoremove -y \ && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* \ No newline at end of file + && rm -rf /var/lib/apt/lists/* + +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file From 0aa87652f4a677162ccd3e0607b58853ea914d41 Mon Sep 17 00:00:00 2001 From: Krystan Honour Date: Sat, 8 Jun 2019 17:48:10 +0100 Subject: [PATCH 03/19] put commends back inline to help demonstrate what commands mean --- containers/typescript-node-8/.devcontainer/Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/containers/typescript-node-8/.devcontainer/Dockerfile b/containers/typescript-node-8/.devcontainer/Dockerfile index 670d5a6232..f880bb2164 100644 --- a/containers/typescript-node-8/.devcontainer/Dockerfile +++ b/containers/typescript-node-8/.devcontainer/Dockerfile @@ -7,11 +7,17 @@ FROM node:8 # Configure apt ENV DEBIAN_FRONTEND=noninteractive + +# Set the default shell to bash instead of sh ENV SHELL /bin/bash + RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ - && apt-get install -y git procps \ + # Verify git and needed tools are installed + && apt-get install -y git procps \ + # Remove outdated yarn from /opt and install via package + # so it can be easily updated via apt-get upgrade yarn && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ @@ -20,7 +26,9 @@ RUN apt-get update \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && apt-get -y install --no-install-recommends yarn \ + # Install tslint and typescript && npm install -g tslint typescript \ + # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* From 7db43f841bed333bb8fea82f7fc4156b5e6edcaf Mon Sep 17 00:00:00 2001 From: Krystan Honour Date: Sat, 8 Jun 2019 19:19:46 +0100 Subject: [PATCH 04/19] placed comments back in and continue with layers that are more optimal as suggested. --- .../.devcontainer/Dockerfile | 1 - .../.devcontainer/Dockerfile | 31 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/containers/typescript-node-8/.devcontainer/Dockerfile b/containers/typescript-node-8/.devcontainer/Dockerfile index f880bb2164..4e17cbcdb2 100644 --- a/containers/typescript-node-8/.devcontainer/Dockerfile +++ b/containers/typescript-node-8/.devcontainer/Dockerfile @@ -11,7 +11,6 @@ ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash instead of sh ENV SHELL /bin/bash - RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ # Verify git and needed tools are installed diff --git a/containers/typescript-node-lts/.devcontainer/Dockerfile b/containers/typescript-node-lts/.devcontainer/Dockerfile index dfb8c6b062..3686104a59 100644 --- a/containers/typescript-node-lts/.devcontainer/Dockerfile +++ b/containers/typescript-node-lts/.devcontainer/Dockerfile @@ -5,33 +5,32 @@ FROM node:lts -# Configure apt ENV DEBIAN_FRONTEND=noninteractive + +# Set the default shell to bash instead of sh +ENV SHELL /bin/bash + +# Configure apt RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 # Verify git and needed tools are installed -RUN apt-get install -y git procps - -# Remove outdated yarn from /opt and install via package -# so it can be easily updated via apt-get upgrade yarn -RUN rm -rf /opt/yarn-* \ +RUN apt-get install -y git procps \ + # Remove outdated yarn from /opt and install via package + # so it can be easily updated via apt-get upgrade yarn + && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ && apt-get install -y curl apt-transport-https lsb-release \ && curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ - && apt-get -y install --no-install-recommends yarn - -# Install tslint and typescript -RUN npm install -g tslint typescript - -# Clean up -RUN apt-get autoremove -y \ + && apt-get -y install --no-install-recommends yarn \ + # Install tslint and typescript + && npm install -g tslint typescript \ + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file From 963ef571083471364eacdadf1b284365264c251f Mon Sep 17 00:00:00 2001 From: Krystan Honour Date: Sat, 8 Jun 2019 19:23:03 +0100 Subject: [PATCH 05/19] added the word 'globally' to better clarify the npm install statement for tslint and typescript --- containers/typescript-node-8/.devcontainer/Dockerfile | 2 +- containers/typescript-node-lts/.devcontainer/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/typescript-node-8/.devcontainer/Dockerfile b/containers/typescript-node-8/.devcontainer/Dockerfile index 4e17cbcdb2..c0a6b1d75b 100644 --- a/containers/typescript-node-8/.devcontainer/Dockerfile +++ b/containers/typescript-node-8/.devcontainer/Dockerfile @@ -25,7 +25,7 @@ RUN apt-get update \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && apt-get -y install --no-install-recommends yarn \ - # Install tslint and typescript + # Install tslint and typescript globally && npm install -g tslint typescript \ # Clean up && apt-get autoremove -y \ diff --git a/containers/typescript-node-lts/.devcontainer/Dockerfile b/containers/typescript-node-lts/.devcontainer/Dockerfile index 3686104a59..715b17f542 100644 --- a/containers/typescript-node-lts/.devcontainer/Dockerfile +++ b/containers/typescript-node-lts/.devcontainer/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get install -y git procps \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && apt-get -y install --no-install-recommends yarn \ - # Install tslint and typescript + # Install tslint and typescript globally && npm install -g tslint typescript \ # Clean up && apt-get autoremove -y \ From bd662182855ac039ea4ab1c278c2f080d49fa7bb Mon Sep 17 00:00:00 2001 From: Krystan Honour Date: Sat, 8 Jun 2019 19:24:33 +0100 Subject: [PATCH 06/19] changed apt update to inline in run statement --- containers/typescript-node-lts/.devcontainer/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/containers/typescript-node-lts/.devcontainer/Dockerfile b/containers/typescript-node-lts/.devcontainer/Dockerfile index 715b17f542..65746bd2db 100644 --- a/containers/typescript-node-lts/.devcontainer/Dockerfile +++ b/containers/typescript-node-lts/.devcontainer/Dockerfile @@ -12,10 +12,9 @@ ENV SHELL /bin/bash # Configure apt RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Verify git and needed tools are installed -RUN apt-get install -y git procps \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # Verify git and needed tools are installed + && apt-get install -y git procps \ # Remove outdated yarn from /opt and install via package # so it can be easily updated via apt-get upgrade yarn && rm -rf /opt/yarn-* \ From ba1060e5dec38eccb43ec0ed3112ab7c92fb1d22 Mon Sep 17 00:00:00 2001 From: Krystan Honour Date: Sat, 8 Jun 2019 19:25:23 +0100 Subject: [PATCH 07/19] corrected positioning of comment --- containers/typescript-node-8/.devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/typescript-node-8/.devcontainer/Dockerfile b/containers/typescript-node-8/.devcontainer/Dockerfile index c0a6b1d75b..0142f7a461 100644 --- a/containers/typescript-node-8/.devcontainer/Dockerfile +++ b/containers/typescript-node-8/.devcontainer/Dockerfile @@ -5,12 +5,12 @@ FROM node:8 -# Configure apt ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash instead of sh ENV SHELL /bin/bash +# Configure apt RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ # Verify git and needed tools are installed From 3133d721a2838d7d1a0e4ef4f267419c12c5ffa3 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 11 Jun 2019 13:10:48 -0700 Subject: [PATCH 08/19] Start of build layer consolidation --- .../docker-compose/.devcontainer/Dockerfile | 35 ++++---- .../dockerfile/.devcontainer/Dockerfile | 33 +++---- .../azure-ansible/.devcontainer/Dockerfile | 78 ++++++++-------- .../azure-blockchain/.devcontainer/Dockerfile | 53 +++++------ containers/azure-cli/.devcontainer/Dockerfile | 33 +++---- .../.devcontainer/Dockerfile | 35 ++++---- .../.devcontainer/Dockerfile | 35 ++++---- .../.devcontainer/Dockerfile | 42 +++++---- .../.devcontainer/devcontainer.json | 5 +- .../.devcontainer/settings.vscode.json | 3 - .../.devcontainer/Dockerfile | 43 ++++----- .../.devcontainer/Dockerfile | 43 ++++----- .../.devcontainer/Dockerfile | 57 ++++++------ .../azure-terraform/.devcontainer/Dockerfile | 88 ++++++++++--------- containers/bazel/.devcontainer/Dockerfile | 49 ++++++----- containers/cpp/.devcontainer/Dockerfile | 28 ++++-- containers/dart/.devcontainer/Dockerfile | 23 +++-- .../debian-9-git/.devcontainer/Dockerfile | 25 +++--- .../.devcontainer/Dockerfile | 31 +++---- .../docker-in-docker/.devcontainer/Dockerfile | 32 ++++--- .../.devcontainer/Dockerfile | 28 +++--- .../dotnetcore-2.1/.devcontainer/Dockerfile | 21 +++-- .../.devcontainer/Dockerfile | 27 ++++-- .../.devcontainer/Dockerfile | 21 +++-- containers/go/.devcontainer/Dockerfile | 63 +++++++------ .../.devcontainer/docker-compose.yml | 2 +- .../kubernetes-helm/.devcontainer/Dockerfile | 87 +++++++++--------- containers/markdown/.devcontainer/Dockerfile | 24 +++-- containers/perl/.devcontainer/Dockerfile | 22 +++-- containers/php-7/.devcontainer/Dockerfile | 32 ++++--- containers/plantuml/.devcontainer/Dockerfile | 28 ++++-- containers/python-2/.devcontainer/Dockerfile | 34 +++---- .../python-2/.devcontainer/devcontainer.json | 7 +- .../.devcontainer/requirements.txt.temp | 0 .../.devcontainer/Dockerfile | 32 ++++--- .../.devcontainer/devcontainer.json | 4 +- .../.devcontainer/environment.yml.temp | 0 .../.devcontainer/Dockerfile | 35 ++++---- .../.devcontainer/devcontainer.json | 4 +- .../.devcontainer/environment.yml.temp | 0 .../.devcontainer/Dockerfile | 36 ++++---- .../.devcontainer/devcontainer.json | 4 +- .../.devcontainer/docker-compose.yml | 2 +- .../.devcontainer/requirements.txt.temp | 0 containers/python-3/.devcontainer/Dockerfile | 35 ++++---- .../python-3/.devcontainer/devcontainer.json | 4 +- .../.devcontainer/requirements.txt.temp | 0 containers/r/.devcontainer/Dockerfile | 41 +++++---- .../ruby-2-rails-5/.devcontainer/Dockerfile | 59 +++++++------ .../ruby-2-sinatra/.devcontainer/Dockerfile | 52 ++++++----- containers/ruby-2/.devcontainer/Dockerfile | 28 +++--- containers/rust/.devcontainer/Dockerfile | 35 +++++--- containers/swift-4/.devcontainer/Dockerfile | 34 ++++--- .../ubuntu-18.04-git/.devcontainer/Dockerfile | 25 +++--- 54 files changed, 913 insertions(+), 684 deletions(-) delete mode 100644 containers/azure-functions-java-8/.devcontainer/settings.vscode.json delete mode 100644 containers/python-2/.devcontainer/requirements.txt.temp delete mode 100644 containers/python-3-anaconda/.devcontainer/environment.yml.temp delete mode 100644 containers/python-3-miniconda/.devcontainer/environment.yml.temp delete mode 100644 containers/python-3-postgres/.devcontainer/requirements.txt.temp delete mode 100644 containers/python-3/.devcontainer/requirements.txt.temp diff --git a/container-templates/docker-compose/.devcontainer/Dockerfile b/container-templates/docker-compose/.devcontainer/Dockerfile index aa45d85ac5..77cbd1b42d 100644 --- a/container-templates/docker-compose/.devcontainer/Dockerfile +++ b/container-templates/docker-compose/.devcontainer/Dockerfile @@ -5,30 +5,33 @@ # ******************************************************** # * Note: A Docker is optional when using Docker Compose * -# * but has been included here for completeness. * +# * but has been included here for completeness. * # ******************************************************** # Debian and Ubuntu based images are supported. Alpine images are not yet supported. FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, process tools, lsb-release (common in install instructions for CLIs) -RUN apt-get -y install git procps lsb-release - -# ***************************************************** -# * Add steps for installing needed dependencies here * -# ***************************************************** +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # ***************************************************** + # * Add steps for installing needed dependencies here * + # ***************************************************** + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash rather than sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/container-templates/dockerfile/.devcontainer/Dockerfile b/container-templates/dockerfile/.devcontainer/Dockerfile index 6b54482a36..728831d04e 100644 --- a/container-templates/dockerfile/.devcontainer/Dockerfile +++ b/container-templates/dockerfile/.devcontainer/Dockerfile @@ -6,23 +6,26 @@ # Debian and Ubuntu based images are supported. Alpine images are not yet supported. FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, process tools, lsb-release (common in install instructions for CLIs) -RUN apt-get -y install git procps lsb-release - -# ***************************************************** -# * Add steps for installing needed dependencies here * -# **************************************************** +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # ***************************************************** + # * Add steps for installing needed dependencies here * + # ***************************************************** + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash rather than sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/azure-ansible/.devcontainer/Dockerfile b/containers/azure-ansible/.devcontainer/Dockerfile index 59b48a980c..2f048e18bc 100644 --- a/containers/azure-ansible/.devcontainer/Dockerfile +++ b/containers/azure-ansible/.devcontainer/Dockerfile @@ -6,13 +6,17 @@ # Pick any base image, but if you select node, skip installing node. 😊 FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install git, required tools -RUN apt-get install -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, required tools installed + && apt-get install -y \ git \ curl \ procps \ @@ -21,38 +25,38 @@ RUN apt-get install -y \ ca-certificates \ gnupg-agent \ software-properties-common \ - lsb-release 2>&1 - -# [Optional] Install Node.js for Azure Cloud Shell support -# Change the "lts/*" in the two lines below to pick a different version -RUN curl -so- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash 2>&1 \ - && /bin/bash -c "source $HOME/.nvm/nvm.sh \ + lsb-release 2>&1 \ + # + # [Optional] Install Node.js for Azure Cloud Shell support + # Change the "lts/*" in the two lines below to pick a different version + && curl -so- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash 2>&1 \ + && /bin/bash -c "source $HOME/.nvm/nvm.sh \ && nvm install lts/* \ - && nvm alias default lts/*" 2>&1 - -# [Optional] For local testing instead of cloud shell -# Install Docker CE CLI. -RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ - && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ - && apt-get update \ - && apt-get install -y docker-ce-cli - -# [Optional] For local testing instead of cloud shell -# Install the Azure CLI -RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ - && curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \ - && apt-get update \ - && apt-get install -y azure-cli - -# Install Ansible -RUN apt-get install -y libssl-dev libffi-dev python-dev python-pip \ - && pip install ansible[azure] - -# Clean up -RUN apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* + && nvm alias default lts/*" 2>&1 \ + # + # [Optional] For local testing instead of cloud shell + # Install Docker CE CLI. + && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ + && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ + && apt-get update \ + && apt-get install -y docker-ce-cli \ + # + # [Optional] For local testing instead of cloud shell + # Install the Azure CLI + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + && curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \ + && apt-get update \ + && apt-get install -y azure-cli \ + # + # Install Ansible + && apt-get install -y libssl-dev libffi-dev python-dev python-pip \ + && pip install ansible[azure] \ + # + # Clean up + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Switch back to dialog for any ad-hoc use of apt-get ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash diff --git a/containers/azure-blockchain/.devcontainer/Dockerfile b/containers/azure-blockchain/.devcontainer/Dockerfile index 817dc408a5..27ad2965bb 100644 --- a/containers/azure-blockchain/.devcontainer/Dockerfile +++ b/containers/azure-blockchain/.devcontainer/Dockerfile @@ -5,36 +5,39 @@ FROM python:2.7 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, process tools -RUN apt-get -y install git procps - -# Install nodejs -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ - && apt-get install -y nodejs - -# Install Truffle Suite -RUN npm i --unsafe-perm -g truffle - -# Install Ganache CLI -RUN npm install -g ganache-cli +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install the Azure CLI -RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools installed + && apt-get -y install git procps \ + # + # Install nodejs + && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ + && apt-get install -y nodejs \ + # + # Install Truffle Suite + && npm i --unsafe-perm -g truffle \ + # + # Install Ganache CLI + && npm install -g ganache-cli \ + # + # Install the Azure CLI + && apt-get install -y apt-transport-https curl gnupg2 lsb-release \ && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \ && apt-get update \ - && apt-get install -y azure-cli - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y azure-cli \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/azure-cli/.devcontainer/Dockerfile b/containers/azure-cli/.devcontainer/Dockerfile index 9f80cce64b..6cc160218e 100644 --- a/containers/azure-cli/.devcontainer/Dockerfile +++ b/containers/azure-cli/.devcontainer/Dockerfile @@ -5,26 +5,29 @@ FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, process tools -RUN apt-get -y install git procps +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install the Azure CLI -RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools installed + && apt-get -y install git procps \ + # + # Install the Azure CLI + && apt-get install -y apt-transport-https curl gnupg2 lsb-release \ && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \ && apt-get update \ - && apt-get install -y azure-cli - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y azure-cli \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile b/containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile index dd0964128a..beab7026b9 100644 --- a/containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile +++ b/containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile @@ -5,32 +5,35 @@ FROM mcr.microsoft.com/dotnet/core/sdk:2.1 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Verify git and needed tools are installed -RUN apt-get -y install \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get -y install \ git \ procps \ curl \ apt-transport-https \ gnupg2 \ - lsb-release - -# Install Azure Functions and Azure CLI -RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + lsb-release \ + # + # Install Azure Functions and Azure CLI + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && apt-get update \ - && apt-get install -y azure-cli azure-functions-core-tools - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y azure-cli azure-functions-core-tools \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile b/containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile index e30d9bdee9..fb248071ec 100644 --- a/containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile +++ b/containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile @@ -5,32 +5,35 @@ FROM mcr.microsoft.com/dotnet/core/sdk:latest -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Verify git and needed tools are installed -RUN apt-get -y install \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get -y install \ git \ procps \ curl \ apt-transport-https \ gnupg2 \ - lsb-release - -# Install Azure Functions and Azure CLI -RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + lsb-release \ + # + # Install Azure Functions and Azure CLI + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && apt-get update \ - && apt-get install -y azure-cli azure-functions-core-tools - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y azure-cli azure-functions-core-tools \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/azure-functions-java-8/.devcontainer/Dockerfile b/containers/azure-functions-java-8/.devcontainer/Dockerfile index 53e917c9a1..146edeb4c0 100644 --- a/containers/azure-functions-java-8/.devcontainer/Dockerfile +++ b/containers/azure-functions-java-8/.devcontainer/Dockerfile @@ -5,35 +5,39 @@ FROM maven:3-jdk-8 -# Copy endpoint specific user settings into container to specify Java path -COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json - -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Verify git and needed tools are installed -RUN apt-get -y install \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get -y install \ git \ procps \ curl \ apt-transport-https \ gnupg2 \ - lsb-release - -# Install Azure Functions, .NET Core, and Azure CLI -RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + lsb-release \ + # + # Install Azure Functions, .NET Core, and Azure CLI + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && apt-get update \ - && apt-get install -y azure-cli dotnet-sdk-2.1 azure-functions-core-tools - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y azure-cli dotnet-sdk-2.1 azure-functions-core-tools \ + # + # Allow for a consistant java home location for settings - image is changing over time + && if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/azure-functions-java-8/.devcontainer/devcontainer.json b/containers/azure-functions-java-8/.devcontainer/devcontainer.json index 35cc463b62..509db82ea5 100644 --- a/containers/azure-functions-java-8/.devcontainer/devcontainer.json +++ b/containers/azure-functions-java-8/.devcontainer/devcontainer.json @@ -12,5 +12,8 @@ "extensions": [ "ms-azuretools.vscode-azurefunctions", "vscjava.vscode-java-pack" - ] + ], + "settings": { + "java.home": "/docker-java-home" + } } \ No newline at end of file diff --git a/containers/azure-functions-java-8/.devcontainer/settings.vscode.json b/containers/azure-functions-java-8/.devcontainer/settings.vscode.json deleted file mode 100644 index e4faefac85..0000000000 --- a/containers/azure-functions-java-8/.devcontainer/settings.vscode.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "java.home": "/docker-java-home" -} \ No newline at end of file diff --git a/containers/azure-functions-node-8/.devcontainer/Dockerfile b/containers/azure-functions-node-8/.devcontainer/Dockerfile index 4b4c389626..519864e01a 100644 --- a/containers/azure-functions-node-8/.devcontainer/Dockerfile +++ b/containers/azure-functions-node-8/.devcontainer/Dockerfile @@ -5,35 +5,38 @@ FROM node:8 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Verify git and needed tools are installed -RUN apt-get -y install \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get -y install \ git \ procps \ curl \ apt-transport-https \ gnupg2 \ - lsb-release - -# Install Azure Functions, .NET Core, and Azure CLI -RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + lsb-release \ + # + # Install Azure Functions, .NET Core, and Azure CLI + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && apt-get update \ - && apt-get install -y azure-cli dotnet-sdk-2.1 azure-functions-core-tools - -# Install eslint -RUN npm install -g eslint - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y azure-cli dotnet-sdk-2.1 azure-functions-core-tools \ + # + # Install eslint + && npm install -g eslint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog - -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/azure-functions-node-lts/.devcontainer/Dockerfile b/containers/azure-functions-node-lts/.devcontainer/Dockerfile index 7113772a03..018efa64ec 100644 --- a/containers/azure-functions-node-lts/.devcontainer/Dockerfile +++ b/containers/azure-functions-node-lts/.devcontainer/Dockerfile @@ -5,35 +5,38 @@ FROM node:lts -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Verify git and needed tools are installed -RUN apt-get -y install \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get -y install \ git \ procps \ curl \ apt-transport-https \ gnupg2 \ - lsb-release - -# Install Azure Functions, .NET Core, and Azure CLI -RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + lsb-release \ + # + # Install Azure Functions, .NET Core, and Azure CLI + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && apt-get update \ - && apt-get install -y azure-cli dotnet-sdk-2.1 azure-functions-core-tools - -# Install eslint -RUN npm install -g eslint - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y azure-cli dotnet-sdk-2.1 azure-functions-core-tools \ + # + # Install eslint + && npm install -g eslint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog - -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile index e3e3b6288f..cd38c27b60 100644 --- a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile +++ b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile @@ -7,37 +7,40 @@ # to use standard python instead FROM continuumio/anaconda3 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, required tools -RUN apt-get install -y \ - git \ - curl \ - procps \ - apt-transport-https \ - ca-certificates \ - gnupg-agent \ - software-properties-common \ - sudo \ - lsb-release 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install Docker CLI -RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, required tools installed + && apt-get install -y \ + git \ + curl \ + procps \ + apt-transport-https \ + ca-certificates \ + gnupg-agent \ + software-properties-common \ + sudo \ + lsb-release 2>&1 \ + # + # Install Docker CLI + && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-ce-cli - -# Install pylint and Azure ML SDK -RUN pip install pylint azureml-sdk[notebooks,automl] 2>&1 - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y docker-ce-cli \ + # + # Install pylint and Azure ML SDK + && pip install pylint azureml-sdk[notebooks,automl] 2>&1 \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/azure-terraform/.devcontainer/Dockerfile b/containers/azure-terraform/.devcontainer/Dockerfile index 37db8166a3..6a9253dbaa 100644 --- a/containers/azure-terraform/.devcontainer/Dockerfile +++ b/containers/azure-terraform/.devcontainer/Dockerfile @@ -6,61 +6,67 @@ # Pick any base image, but if you select node, skip installing node. 😊 FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, required tools -RUN apt-get install -y \ - git \ - curl \ - procps \ - unzip \ - apt-transport-https \ - ca-certificates \ - gnupg-agent \ - software-properties-common \ - lsb-release 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash +# Terraform and tflint versions +ENV TERRAFORM_VERSION=0.11.13 +ENV TFLINT_VERSION=0.7.5 -# [Optional] Install Node.js for Azure Cloud Shell support -# Change the "lts/*" in the two lines below to pick a different version -RUN curl -so- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash 2>&1 \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Install git, required tools installed + && apt-get install -y \ + git \ + curl \ + procps \ + unzip \ + apt-transport-https \ + ca-certificates \ + gnupg-agent \ + software-properties-common \ + lsb-release 2>&1 \ + # + # [Optional] Install Node.js for Azure Cloud Shell support + # Change the "lts/*" in the two lines below to pick a different version + && curl -so- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash 2>&1 \ && /bin/bash -c "source $HOME/.nvm/nvm.sh \ && nvm install lts/* \ - && nvm alias default lts/*" 2>&1 - -# [Optional] For local testing instead of cloud shell -# Install Docker CE CLI. -RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ + && nvm alias default lts/*" 2>&1 \ + # + # [Optional] For local testing instead of cloud shell + # Install Docker CE CLI. + && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-ce-cli - -# [Optional] For local testing instead of cloud shell -# Install the Azure CLI -RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + && apt-get install -y docker-ce-cli \ + # + # [Optional] For local testing instead of cloud shell + # Install the Azure CLI + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ && curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \ && apt-get update \ - && apt-get install -y azure-cli - -# Install Terraform, tflint, and graphviz -RUN mkdir -p /tmp/docker-downloads \ - && curl -sSL -o /tmp/docker-downloads/terraform.zip https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip \ + && apt-get install -y azure-cli \ + # + # Install Terraform, tflint, and graphviz + && mkdir -p /tmp/docker-downloads \ + && curl -sSL -o /tmp/docker-downloads/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \ && unzip /tmp/docker-downloads/terraform.zip \ && mv terraform /usr/local/bin \ - && curl -sSL -o /tmp/docker-downloads/tflint.zip https://github.com/wata727/tflint/releases/download/v0.7.5/tflint_linux_amd64.zip \ + && curl -sSL -o /tmp/docker-downloads/tflint.zip https://github.com/wata727/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip \ && unzip /tmp/docker-downloads/tflint.zip \ && mv tflint /usr/local/bin \ && cd ~ \ && rm -rf /tmp/docker-downloads \ - && apt-get install -y graphviz - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y graphviz \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/bazel/.devcontainer/Dockerfile b/containers/bazel/.devcontainer/Dockerfile index 87ec844956..c779eef80a 100644 --- a/containers/bazel/.devcontainer/Dockerfile +++ b/containers/bazel/.devcontainer/Dockerfile @@ -4,34 +4,37 @@ #------------------------------------------------------------------------------------------------------------- FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, process tools, lsb-release (common in install instructions for CLIs) -RUN apt-get -y install git procps lsb-release +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash +# Bazel version and hash +ENV BAZEL_VERSION=0.25.2 +ENV BAZEL_SHA256=5b9ab8a68c53421256909f79c47bde76a051910217531cbf35ee995448254fa7 -# Install Bazel -ENV BAZEL_VERSION=0.25.2 -ENV BAZEL_SHA256=5b9ab8a68c53421256909f79c47bde76a051910217531cbf35ee995448254fa7 -RUN apt-get -y install curl pkg-config zip g++ zlib1g-dev unzip python -RUN curl -fSsL -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.25.2/bazel-0.25.2-installer-linux-x86_64.sh \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verifty git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install Bazel + && apt-get -y install curl pkg-config zip g++ zlib1g-dev unzip python \ + && curl -fSsL -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.25.2/bazel-0.25.2-installer-linux-x86_64.sh \ && echo "${BAZEL_SHA256} *bazel-installer.sh" | sha256sum --check - \ && chmod +x bazel-installer.sh \ && ./bazel-installer.sh \ - && rm ./bazel-installer.sh - -RUN echo '\n\ - export PATH="$PATH:$HOME/bin" \n\ - '\ - >> $HOME/.bashrc - -# Clean up -RUN apt-get autoremove -y \ + && rm ./bazel-installer.sh \ + && echo '\n\ + export PATH="$PATH:$HOME/bin" \n\ + '\ + >> $HOME/.bashrc \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Use bash as the default shell instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/cpp/.devcontainer/Dockerfile b/containers/cpp/.devcontainer/Dockerfile index fa8919a10f..c4bccd4941 100644 --- a/containers/cpp/.devcontainer/Dockerfile +++ b/containers/cpp/.devcontainer/Dockerfile @@ -5,16 +5,26 @@ FROM debian:9 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install C++ tools -RUN apt-get -y install build-essential cmake cppcheck valgrind - -# Clean up -RUN apt-get autoremove -y \ +RUN apt-get update \ + # + # Configure apt + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (useful for CLI installs) installed + && apt-get update && apt-get -y install git procps lsb-release \ + # + # Install C++ tools + && apt-get -y install build-essential cmake cppcheck valgrind \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/dart/.devcontainer/Dockerfile b/containers/dart/.devcontainer/Dockerfile index 2079c18cb3..eddeb62550 100644 --- a/containers/dart/.devcontainer/Dockerfile +++ b/containers/dart/.devcontainer/Dockerfile @@ -5,15 +5,24 @@ FROM google/dart:2 +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash +# Add bin location to path ENV PATH="$PATH":"/root/.pub-cache/bin" -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/debian-9-git/.devcontainer/Dockerfile b/containers/debian-9-git/.devcontainer/Dockerfile index 5dc593a7d3..77dbb29494 100644 --- a/containers/debian-9-git/.devcontainer/Dockerfile +++ b/containers/debian-9-git/.devcontainer/Dockerfile @@ -4,19 +4,22 @@ #------------------------------------------------------------------------------------------------------------- FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, process tools, lsb-release (common in install instructions for CLIs) -RUN apt-get -y install git procps lsb-release +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/docker-in-docker-compose/.devcontainer/Dockerfile b/containers/docker-in-docker-compose/.devcontainer/Dockerfile index b52f87d684..2cb5b3aafa 100644 --- a/containers/docker-in-docker-compose/.devcontainer/Dockerfile +++ b/containers/docker-in-docker-compose/.devcontainer/Dockerfile @@ -6,27 +6,24 @@ # Note: You can use any Debian/Ubuntu based image you want. FROM debian:9 -# Configure apt -ENV DEBIAN_FRONTEND=noninteractive +# Configure apt and install packages RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Verify git, process tools installed -RUN apt-get -y install git procps - -# Install Docker CE CLI -RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools installed + && apt-get -y install git procps \ + # + # Install Docker CE CLI + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-ce-cli - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y docker-ce-cli \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog - -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/docker-in-docker/.devcontainer/Dockerfile b/containers/docker-in-docker/.devcontainer/Dockerfile index f890c39ff3..6de419bd0b 100644 --- a/containers/docker-in-docker/.devcontainer/Dockerfile +++ b/containers/docker-in-docker/.devcontainer/Dockerfile @@ -7,26 +7,30 @@ # Note: You can use any Debian/Ubuntu based image you want. FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Verify git, process tools installed -RUN apt-get -y install git procps -# Install Docker CE CLI -RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools installed + && apt-get -y install git procps \ + # + # Install Docker CE CLI + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-ce-cli - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y docker-ce-cli \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile b/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile index afd2255de7..47ecbe0911 100644 --- a/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile +++ b/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile @@ -5,17 +5,25 @@ FROM mcr.microsoft.com/dotnet/core/sdk:2.1 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Install fsharp -RUN apt-get install -y fsharp +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) + && apt-get -y install git procps lsb-release \ + # + # Install F# + && apt-get install fsharp \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash - +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/dotnetcore-2.1/.devcontainer/Dockerfile b/containers/dotnetcore-2.1/.devcontainer/Dockerfile index ba25c44bba..9c6e21efc6 100644 --- a/containers/dotnetcore-2.1/.devcontainer/Dockerfile +++ b/containers/dotnetcore-2.1/.devcontainer/Dockerfile @@ -5,13 +5,22 @@ FROM mcr.microsoft.com/dotnet/core/sdk:2.1 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile b/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile index 4c8544e97b..f924d5dca0 100644 --- a/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile +++ b/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile @@ -5,16 +5,25 @@ FROM mcr.microsoft.com/dotnet/core/sdk:latest -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Install fsharp -RUN apt-get install -y fsharp +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install F# + && apt-get install fsharp \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/dotnetcore-latest/.devcontainer/Dockerfile b/containers/dotnetcore-latest/.devcontainer/Dockerfile index 5cb59da8ab..c0754850b1 100644 --- a/containers/dotnetcore-latest/.devcontainer/Dockerfile +++ b/containers/dotnetcore-latest/.devcontainer/Dockerfile @@ -5,13 +5,22 @@ FROM mcr.microsoft.com/dotnet/core/sdk:latest -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/go/.devcontainer/Dockerfile b/containers/go/.devcontainer/Dockerfile index e14ea4d7b2..adbef3db6c 100644 --- a/containers/go/.devcontainer/Dockerfile +++ b/containers/go/.devcontainer/Dockerfile @@ -5,36 +5,41 @@ FROM golang:1 -RUN go get -u -v \ - github.com/mdempsky/gocode \ - github.com/uudashr/gopkgs/cmd/gopkgs \ - github.com/ramya-rao-a/go-outline \ - github.com/acroca/go-symbols \ - golang.org/x/tools/cmd/guru \ - golang.org/x/tools/cmd/gorename \ - github.com/rogpeppe/godef \ - github.com/zmb3/gogetdoc \ - github.com/sqs/goreturns \ - golang.org/x/tools/cmd/goimports \ - golang.org/x/lint/golint \ - github.com/alecthomas/gometalinter \ - honnef.co/go/tools/... \ - github.com/golangci/golangci-lint/cmd/golangci-lint \ - github.com/mgechev/revive \ - github.com/derekparker/delve/cmd/dlv 2>&1 - -# gocode-gomod -RUN go get -x -d github.com/stamblerre/gocode \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install Go dependencies + && go get -u -v \ + github.com/mdempsky/gocode \ + github.com/uudashr/gopkgs/cmd/gopkgs \ + github.com/ramya-rao-a/go-outline \ + github.com/acroca/go-symbols \ + golang.org/x/tools/cmd/guru \ + golang.org/x/tools/cmd/gorename \ + github.com/rogpeppe/godef \ + github.com/zmb3/gogetdoc \ + github.com/sqs/goreturns \ + golang.org/x/tools/cmd/goimports \ + golang.org/x/lint/golint \ + github.com/alecthomas/gometalinter \ + honnef.co/go/tools/... \ + github.com/golangci/golangci-lint/cmd/golangci-lint \ + github.com/mgechev/revive \ + github.com/derekparker/delve/cmd/dlv 2>&1 \ + # + # Install gocode-gomod + && go get -x -d github.com/stamblerre/gocode \ && go build -o gocode-gomod github.com/stamblerre/gocode \ - && mv gocode-gomod $GOPATH/bin/ - -# Install git, process tools, lsb-release (common in install instructions for CLIs) -RUN apt-get update && apt-get -y install git procps lsb-release - -# Clean up -RUN apt-get autoremove -y \ + && mv gocode-gomod $GOPATH/bin/ \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/javascript-node-lts-mongo/.devcontainer/docker-compose.yml b/containers/javascript-node-lts-mongo/.devcontainer/docker-compose.yml index 71607f7b46..d0a0d1c30e 100644 --- a/containers/javascript-node-lts-mongo/.devcontainer/docker-compose.yml +++ b/containers/javascript-node-lts-mongo/.devcontainer/docker-compose.yml @@ -23,7 +23,7 @@ services: mongo: image: mongo - restart: unless-stopped + restart: unless-stopped volumes: - /data/db diff --git a/containers/kubernetes-helm/.devcontainer/Dockerfile b/containers/kubernetes-helm/.devcontainer/Dockerfile index d5624ed077..04046477d5 100644 --- a/containers/kubernetes-helm/.devcontainer/Dockerfile +++ b/containers/kubernetes-helm/.devcontainer/Dockerfile @@ -6,55 +6,58 @@ # You can use any Debian/Ubuntu based image as a base FROM debian:9 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Verify git, process tools installed -RUN apt-get -y install git procps +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install Docker CE CLI -RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools installed + && apt-get -y install git procps \ + # + # Install Docker CE CLI + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-ce-cli - -# Install kubectl -RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ + && apt-get install -y docker-ce-cli \ + # + # Install kubectl + && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ && echo "deb https://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/kubernetes.list \ && apt-get update \ - && apt-get install -y kubectl - -# Install Helm -RUN curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash - - -# Copy localhost's ~/.kube/config file into the container and swap out localhost -# for host.docker.internal whenever a new shell starts to keep them in sync. -RUN echo '\n\ -if [ "$SYNC_LOCALHOST_KUBECONFIG" == "true" ]; then\n\ - mkdir -p $HOME/.kube\n\ - cp -r $HOME/.kube-localhost/* $HOME/.kube\n\ - sed -i -e "s/localhost/host.docker.internal/g" $HOME/.kube/config\n\ -\n\ - if [ -d "$HOME/.minikube-localhost" ]; then\n\ - mkdir -p $HOME/.minikube\n\ - cp -r $HOME/.minikube-localhost/ca.crt $HOME/.minikube\n\ - sed -i -r "s|(\s*certificate-authority:\s).*|\\1$HOME\/.minikube\/ca.crt|g" $HOME/.kube/config\n\ - cp -r $HOME/.minikube-localhost/client.crt $HOME/.minikube\n\ - sed -i -r "s|(\s*client-certificate:\s).*|\\1$HOME\/.minikube\/client.crt|g" $HOME/.kube/config\n\ - cp -r $HOME/.minikube-localhost/client.key $HOME/.minikube\n\ - sed -i -r "s|(\s*client-key:\s).*|\\1$HOME\/.minikube\/client.key|g" $HOME/.kube/config\n\ - fi\n\ -fi' \ ->> $HOME/.bashrc - -# Clean up -RUN apt-get autoremove -y \ + && apt-get install -y kubectl \ + # + # Install Helm + && curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash - \ + # + # Copy localhost's ~/.kube/config file into the container and swap out localhost + # for host.docker.internal whenever a new shell starts to keep them in sync. + && echo '\n\ + if [ "$SYNC_LOCALHOST_KUBECONFIG" == "true" ]; then\n\ + mkdir -p $HOME/.kube\n\ + cp -r $HOME/.kube-localhost/* $HOME/.kube\n\ + sed -i -e "s/localhost/host.docker.internal/g" $HOME/.kube/config\n\ + \n\ + if [ -d "$HOME/.minikube-localhost" ]; then\n\ + mkdir -p $HOME/.minikube\n\ + cp -r $HOME/.minikube-localhost/ca.crt $HOME/.minikube\n\ + sed -i -r "s|(\s*certificate-authority:\s).*|\\1$HOME\/.minikube\/ca.crt|g" $HOME/.kube/config\n\ + cp -r $HOME/.minikube-localhost/client.crt $HOME/.minikube\n\ + sed -i -r "s|(\s*client-certificate:\s).*|\\1$HOME\/.minikube\/client.crt|g" $HOME/.kube/config\n\ + cp -r $HOME/.minikube-localhost/client.key $HOME/.minikube\n\ + sed -i -r "s|(\s*client-key:\s).*|\\1$HOME\/.minikube\/client.key|g" $HOME/.kube/config\n\ + fi\n\ + fi' \ + >> $HOME/.bashrc \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash to make sure .bashrc script is run -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/markdown/.devcontainer/Dockerfile b/containers/markdown/.devcontainer/Dockerfile index 95564857b3..9f862a8599 100644 --- a/containers/markdown/.devcontainer/Dockerfile +++ b/containers/markdown/.devcontainer/Dockerfile @@ -5,13 +5,25 @@ FROM debian:9 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ + +# Configure apt and install packages +RUN apt-get update \ + # + # Configure apt + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get install -y git procps lsb-release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/perl/.devcontainer/Dockerfile b/containers/perl/.devcontainer/Dockerfile index a98b064309..b30e7192e9 100644 --- a/containers/perl/.devcontainer/Dockerfile +++ b/containers/perl/.devcontainer/Dockerfile @@ -5,14 +5,22 @@ FROM perl:5 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash - -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/php-7/.devcontainer/Dockerfile b/containers/php-7/.devcontainer/Dockerfile index e909cc9d65..b5505a3e35 100644 --- a/containers/php-7/.devcontainer/Dockerfile +++ b/containers/php-7/.devcontainer/Dockerfile @@ -5,20 +5,30 @@ FROM php:7-cli -# Install xdebug -RUN yes | pecl install xdebug \ +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash + +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Install git, procps, lsb-release (useful for CLI installs) + && apt-get -y install git procps lsb-release \ + # + # Install xdebug + && yes | pecl install xdebug \ && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ - && echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini - -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Clean up -RUN apt-get autoremove -y \ + && echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog + diff --git a/containers/plantuml/.devcontainer/Dockerfile b/containers/plantuml/.devcontainer/Dockerfile index 0f5171c273..ba52230a78 100644 --- a/containers/plantuml/.devcontainer/Dockerfile +++ b/containers/plantuml/.devcontainer/Dockerfile @@ -5,17 +5,27 @@ FROM openjdk:8 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Install GraphViz -RUN apt-get install -y graphviz +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install GraphViz + && apt-get install -y graphviz \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog + diff --git a/containers/python-2/.devcontainer/Dockerfile b/containers/python-2/.devcontainer/Dockerfile index 603323bc46..efd867c496 100644 --- a/containers/python-2/.devcontainer/Dockerfile +++ b/containers/python-2/.devcontainer/Dockerfile @@ -5,23 +5,25 @@ FROM python:2 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -RUN mkdir /workspace -WORKDIR /workspace - -# Install pylint -RUN pip install pylint - -# Install Python dependencies from requirements.txt if it exists -COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/ -RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt*; fi - -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install pylint + && pip install pylint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/python-2/.devcontainer/devcontainer.json b/containers/python-2/.devcontainer/devcontainer.json index 1c33652349..ad5a761718 100644 --- a/containers/python-2/.devcontainer/devcontainer.json +++ b/containers/python-2/.devcontainer/devcontainer.json @@ -6,9 +6,6 @@ // Uncomment the next line if you want to publish any ports. // "appPort": [], - // Uncomment the next line to run commands after the container is created. - // "postCreateCommand": "python --version", - "extensions": [ "ms-python.python" ], @@ -16,5 +13,7 @@ "python.pythonPath": "/usr/local/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - } + }, + // Install contents of requirements.txt if present + "postCreateCommand": "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi" } diff --git a/containers/python-2/.devcontainer/requirements.txt.temp b/containers/python-2/.devcontainer/requirements.txt.temp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/containers/python-3-anaconda/.devcontainer/Dockerfile b/containers/python-3-anaconda/.devcontainer/Dockerfile index 3911d0f476..02a5627ab5 100644 --- a/containers/python-3-anaconda/.devcontainer/Dockerfile +++ b/containers/python-3-anaconda/.devcontainer/Dockerfile @@ -5,21 +5,27 @@ FROM continuumio/anaconda3 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -RUN mkdir /workspace -WORKDIR /workspace - -# Install Python dependencies from requirements.txt if it exists -COPY .devcontainer/environment.yml.temp environment.yml* /workspace/ -RUN if [ -f "environment.yml" ]; then conda env update base -f environment.yml && rm environment.yml*; fi +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install pylint + && pip install pylint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog + diff --git a/containers/python-3-anaconda/.devcontainer/devcontainer.json b/containers/python-3-anaconda/.devcontainer/devcontainer.json index 06e70c4fec..51098bb984 100644 --- a/containers/python-3-anaconda/.devcontainer/devcontainer.json +++ b/containers/python-3-anaconda/.devcontainer/devcontainer.json @@ -16,5 +16,7 @@ "python.pythonPath": "/opt/conda/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - } + }, + // Install contents of environment.yml if present + "postCreateCommand": "if [ -f environment.yml ]; conda env update base -f environment.yml; fi" } \ No newline at end of file diff --git a/containers/python-3-anaconda/.devcontainer/environment.yml.temp b/containers/python-3-anaconda/.devcontainer/environment.yml.temp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/containers/python-3-miniconda/.devcontainer/Dockerfile b/containers/python-3-miniconda/.devcontainer/Dockerfile index 26a15c98a4..1f8b5c3398 100644 --- a/containers/python-3-miniconda/.devcontainer/Dockerfile +++ b/containers/python-3-miniconda/.devcontainer/Dockerfile @@ -5,24 +5,25 @@ FROM continuumio/miniconda3 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -RUN mkdir /workspace -WORKDIR /workspace - -# Install pylint -RUN pip install pylint - -# Install Python dependencies from requirements.txt if it exists -COPY .devcontainer/environment.yml.temp environment.yml* /workspace/ -RUN if [ -f "environment.yml" ]; then conda env update base -f environment.yml && rm environment.yml*; fi +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install pylint + && pip install pylint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash - +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/python-3-miniconda/.devcontainer/devcontainer.json b/containers/python-3-miniconda/.devcontainer/devcontainer.json index 1cdba66fd1..4af94e8833 100644 --- a/containers/python-3-miniconda/.devcontainer/devcontainer.json +++ b/containers/python-3-miniconda/.devcontainer/devcontainer.json @@ -16,5 +16,7 @@ "python.pythonPath": "/opt/conda/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - } + }, + // Install contents of environment.yml if present + "postCreateCommand": "if [ -f environment.yml ]; conda env update base -f environment.yml; fi" } \ No newline at end of file diff --git a/containers/python-3-miniconda/.devcontainer/environment.yml.temp b/containers/python-3-miniconda/.devcontainer/environment.yml.temp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/containers/python-3-postgres/.devcontainer/Dockerfile b/containers/python-3-postgres/.devcontainer/Dockerfile index f00790e428..3913ae8f7b 100644 --- a/containers/python-3-postgres/.devcontainer/Dockerfile +++ b/containers/python-3-postgres/.devcontainer/Dockerfile @@ -5,25 +5,27 @@ FROM python:3 -ENV PYTHONUNBUFFERED 1 - -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -RUN mkdir /workspace -WORKDIR /workspace +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install pylint -RUN pip install pylint - -# Install Python dependencies from requirements.txt if it exists -COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/ -RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt; fi +ENV PYTHONUNBUFFERED 1 -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install pylint + && pip install pylint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/python-3-postgres/.devcontainer/devcontainer.json b/containers/python-3-postgres/.devcontainer/devcontainer.json index 1e1093f169..79f0212d21 100644 --- a/containers/python-3-postgres/.devcontainer/devcontainer.json +++ b/containers/python-3-postgres/.devcontainer/devcontainer.json @@ -17,5 +17,7 @@ "python.pythonPath": "/usr/local/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - } + }, + // Install contents of environment.yml if present + "postCreateCommand": "if [ -f environment.yml ]; conda env update base -f environment.yml; fi" } \ No newline at end of file diff --git a/containers/python-3-postgres/.devcontainer/docker-compose.yml b/containers/python-3-postgres/.devcontainer/docker-compose.yml index 554db7ca61..c7aefb2ba0 100644 --- a/containers/python-3-postgres/.devcontainer/docker-compose.yml +++ b/containers/python-3-postgres/.devcontainer/docker-compose.yml @@ -19,7 +19,7 @@ services: db: image: postgres - restart: always + restart: unless-stopped ports: - 5432:5432 environment: diff --git a/containers/python-3-postgres/.devcontainer/requirements.txt.temp b/containers/python-3-postgres/.devcontainer/requirements.txt.temp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/containers/python-3/.devcontainer/Dockerfile b/containers/python-3/.devcontainer/Dockerfile index 7491d4dbff..9d86501bc1 100644 --- a/containers/python-3/.devcontainer/Dockerfile +++ b/containers/python-3/.devcontainer/Dockerfile @@ -5,24 +5,27 @@ FROM python:3 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -RUN mkdir /workspace -WORKDIR /workspace - -# Install pylint -RUN pip install pylint - -# Install Python dependencies from requirements.txt if it exists -COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/ -RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt*; fi +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install pylint + && pip install pylint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog + diff --git a/containers/python-3/.devcontainer/devcontainer.json b/containers/python-3/.devcontainer/devcontainer.json index 98c3287494..829dafa7c0 100644 --- a/containers/python-3/.devcontainer/devcontainer.json +++ b/containers/python-3/.devcontainer/devcontainer.json @@ -16,5 +16,7 @@ "python.pythonPath": "/usr/local/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - } + }, + // Install contents of requirements.txt if present + "postCreateCommand": "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi" } \ No newline at end of file diff --git a/containers/python-3/.devcontainer/requirements.txt.temp b/containers/python-3/.devcontainer/requirements.txt.temp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/containers/r/.devcontainer/Dockerfile b/containers/r/.devcontainer/Dockerfile index 0d5502de78..f6ab2db70c 100644 --- a/containers/r/.devcontainer/Dockerfile +++ b/containers/r/.devcontainer/Dockerfile @@ -5,23 +5,32 @@ FROM rocker/r-apt:bionic -# Install git, process tools, lsb-release (common in install instructions for CLIs) and libzip for R Tools extension -RUN apt-get update && apt-get -y install git procps lsb-release libzip-dev +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Register Microsoft key and feed -RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb && \ - dpkg -i packages-microsoft-prod.deb - -# Install the .NET Runtime -RUN add-apt-repository universe && \ - apt-get install apt-transport-https && \ - apt-get update && \ - apt-get -y install dotnet-runtime-2.1 - -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Install git, process tools, lsb-release (common in install instructions for CLIs) and libzip for R Tools extension + && apt-get -y install git procps lsb-release libzip-dev \ + # + # Register Microsoft key and feed + && wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \ + && dpkg -i packages-microsoft-prod.deb \ + # + # Install the .NET Runtime + && add-apt-repository universe \ + && apt-get install apt-transport-https \ + && apt-get update \ + && apt-get -y install dotnet-runtime-2.1 \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/ruby-2-rails-5/.devcontainer/Dockerfile b/containers/ruby-2-rails-5/.devcontainer/Dockerfile index 7d790fdce7..867fae0678 100644 --- a/containers/ruby-2-rails-5/.devcontainer/Dockerfile +++ b/containers/ruby-2-rails-5/.devcontainer/Dockerfile @@ -1,40 +1,49 @@ FROM debian:latest -# Install vim, git, process tools +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash + +# Configure apt and install packages RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Install vim, git, process tools, lsb-release + RUN apt-get update \ + && apt-get install -y \ + vim \ + git \ + procps \ + lsb-release \ + # + # Install ruby && apt-get install -y \ - vim \ - git \ - procps - -# Install ruby -RUN apt-get install -y \ ruby \ ruby-dev \ build-essential \ libsqlite3-dev \ zlib1g-dev \ - libxml2 - -# Install nodejs -RUN apt-get install -y \ - nodejs - -# Install debug tools -RUN gem install \ + libxml2 \ + # + # Install nodejs + && apt-get install -y nodejs \ + # + # Install debug tools + && gem install \ rake \ ruby-debug-ide \ - debase - -# Install sinatra MVC components -RUN gem install \ + debase \ + # + # Install sinatra MVC components + && gem install \ rails \ - webdrivers - -# Clean up -RUN apt-get autoremove -y \ + webdrivers \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/ruby-2-sinatra/.devcontainer/Dockerfile b/containers/ruby-2-sinatra/.devcontainer/Dockerfile index 8d11aae058..3731349629 100644 --- a/containers/ruby-2-sinatra/.devcontainer/Dockerfile +++ b/containers/ruby-2-sinatra/.devcontainer/Dockerfile @@ -1,37 +1,47 @@ FROM debian:latest -# Install vim, git, process tools +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash + +# Configure apt and install packages RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Install vim, git, process tools, lsb-release + && apt-get update \ && apt-get install -y \ vim \ git \ - procps - -# Install ruby -RUN apt-get install -y \ + procps \ + lsb-release \ + # + # Install ruby + && apt-get install -y \ ruby \ ruby-dev \ build-essential \ - libsqlite3-dev - -# Install debug tools -RUN gem install \ + libsqlite3-dev \ + # + # Install debug tools + && gem install \ rake \ ruby-debug-ide \ - debase - -# Install sinatra MVC components -RUN gem install \ + debase \ + # + # Install sinatra MVC components + && gem install \ sinatra \ sinatra-reloader \ thin \ data_mapper \ - dm-sqlite-adapter - -# Clean up -RUN apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* + dm-sqlite-adapter \ + # + # Clean up + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/ruby-2/.devcontainer/Dockerfile b/containers/ruby-2/.devcontainer/Dockerfile index 195d5fa2ff..d672e40757 100644 --- a/containers/ruby-2/.devcontainer/Dockerfile +++ b/containers/ruby-2/.devcontainer/Dockerfile @@ -5,17 +5,25 @@ FROM ruby:2 -# Install ruby-debug-ide and debase -RUN gem install ruby-debug-ide -RUN gem install debase +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # Verify git, process tools installed + && apt-get update && apt-get -y install git procps lsb-release \ + # + # Install ruby-debug-ide and debase + && gem install ruby-debug-ide \ + && gem install debase \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/rust/.devcontainer/Dockerfile b/containers/rust/.devcontainer/Dockerfile index 99207a5018..e0aa5e542e 100644 --- a/containers/rust/.devcontainer/Dockerfile +++ b/containers/rust/.devcontainer/Dockerfile @@ -4,20 +4,29 @@ #------------------------------------------------------------------------------------------------------------- FROM rust:1 +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -RUN rustup update -RUN rustup component add rls rust-analysis rust-src - -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Install other dependencies -RUN apt-get install -y lldb-3.9 - -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, needed tools installed + && apt-get -y install git procps lsb-release \ + # + # Install other dependencies + && apt-get install -y lldb-3.9 \ + # + # Install Rust components + && rustup update \ + && rustup component add rls rust-analysis rust-src \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/swift-4/.devcontainer/Dockerfile b/containers/swift-4/.devcontainer/Dockerfile index c9665a6550..e8930070e9 100644 --- a/containers/swift-4/.devcontainer/Dockerfile +++ b/containers/swift-4/.devcontainer/Dockerfile @@ -5,19 +5,29 @@ FROM swift:4 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps - -# Install SourceKite, see https://github.com/vknabel/vscode-swift-development-environment/blob/master/README.md#installation -RUN git clone https://github.com/jinmingjian/sourcekite.git -RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/swift:/usr/lib -RUN ln -s /usr/lib/libsourcekitdInProc.so /usr/lib/sourcekitdInProc -RUN cd sourcekite && swift build -Xlinker -l:sourcekitdInProc -c release +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Install SourceKite, see https://github.com/vknabel/vscode-swift-development-environment/blob/master/README.md#installation + && git clone https://github.com/jinmingjian/sourcekite.git \ + && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/swift:/usr/lib \ + && ln -s /usr/lib/libsourcekitdInProc.so /usr/lib/sourcekitdInProc \ + && cd sourcekite && swift build -Xlinker -l:sourcekitdInProc -c release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog + diff --git a/containers/ubuntu-18.04-git/.devcontainer/Dockerfile b/containers/ubuntu-18.04-git/.devcontainer/Dockerfile index a308473ecc..127c43d931 100644 --- a/containers/ubuntu-18.04-git/.devcontainer/Dockerfile +++ b/containers/ubuntu-18.04-git/.devcontainer/Dockerfile @@ -4,19 +4,22 @@ #------------------------------------------------------------------------------------------------------------- FROM ubuntu:bionic -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Install git, process tools, lsb-release (common in install instructions for CLIs) -RUN apt-get -y install git procps lsb-release +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash -# Clean up -RUN apt-get autoremove -y \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed + && apt-get -y install git procps lsb-release \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file From 6de9d75eb357364558660b449064359547f53c69 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 11 Jun 2019 21:18:31 +0000 Subject: [PATCH 09/19] Fixes for postCreateCommand --- containers/python-3-anaconda/.devcontainer/devcontainer.json | 2 +- containers/python-3-miniconda/.devcontainer/devcontainer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/python-3-anaconda/.devcontainer/devcontainer.json b/containers/python-3-anaconda/.devcontainer/devcontainer.json index 51098bb984..4e98fd43d4 100644 --- a/containers/python-3-anaconda/.devcontainer/devcontainer.json +++ b/containers/python-3-anaconda/.devcontainer/devcontainer.json @@ -18,5 +18,5 @@ "python.linting.enabled": true }, // Install contents of environment.yml if present - "postCreateCommand": "if [ -f environment.yml ]; conda env update base -f environment.yml; fi" + "postCreateCommand": "if [ -f environment.yml ]; then conda env update base -f environment.yml; fi" } \ No newline at end of file diff --git a/containers/python-3-miniconda/.devcontainer/devcontainer.json b/containers/python-3-miniconda/.devcontainer/devcontainer.json index 4af94e8833..e780e37ed1 100644 --- a/containers/python-3-miniconda/.devcontainer/devcontainer.json +++ b/containers/python-3-miniconda/.devcontainer/devcontainer.json @@ -18,5 +18,5 @@ "python.linting.enabled": true }, // Install contents of environment.yml if present - "postCreateCommand": "if [ -f environment.yml ]; conda env update base -f environment.yml; fi" + "postCreateCommand": "if [ -f environment.yml ]; then conda env update base -f environment.yml; fi" } \ No newline at end of file From 5171ed013d8186d1e06e64232ee018606965011c Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 11 Jun 2019 21:44:35 +0000 Subject: [PATCH 10/19] Fix bad environment.yml and test project --- containers/python-3-miniconda/environment.yml | 7 ++++--- containers/python-3-miniconda/test-project/hello.py | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/containers/python-3-miniconda/environment.yml b/containers/python-3-miniconda/environment.yml index 2a6b35fb84..e83fd27b0d 100644 --- a/containers/python-3-miniconda/environment.yml +++ b/containers/python-3-miniconda/environment.yml @@ -1,3 +1,4 @@ -jupyter -numpy -matplotlib +dependencies: + - jupyter + - numpy + - matplotlib \ No newline at end of file diff --git a/containers/python-3-miniconda/test-project/hello.py b/containers/python-3-miniconda/test-project/hello.py index 0ad1eb34f7..76f93b22fa 100644 --- a/containers/python-3-miniconda/test-project/hello.py +++ b/containers/python-3-miniconda/test-project/hello.py @@ -19,7 +19,10 @@ title='About as simple as it gets, folks') ax.grid() -fig.savefig("plot.png") +fig.savefig("test-project/plot.png") plt.show() print('Open test-project/plot.png to see the result!') + + +#%% From d02cac805579918d4ff4e0ab7ed8136964169c2c Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 11 Jun 2019 19:08:25 -0700 Subject: [PATCH 11/19] Fixes and formatting --- .../dotnetcore-2.1-fsharp/.devcontainer/Dockerfile | 2 +- .../.devcontainer/Dockerfile | 2 +- .../ruby-2-rails-5/.devcontainer/devcontainer.json | 14 +++++++++----- .../ruby-2-sinatra/.devcontainer/devcontainer.json | 11 +++++++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile b/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile index 47ecbe0911..77651150c8 100644 --- a/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile +++ b/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update \ && apt-get -y install git procps lsb-release \ # # Install F# - && apt-get install fsharp \ + && apt-get install -y fsharp \ # # Clean up && apt-get autoremove -y \ diff --git a/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile b/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile index f924d5dca0..1403b586f2 100644 --- a/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile +++ b/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update \ && apt-get -y install git procps lsb-release \ # # Install F# - && apt-get install fsharp \ + && apt-get install -y fsharp \ # # Clean up && apt-get autoremove -y \ diff --git a/containers/ruby-2-rails-5/.devcontainer/devcontainer.json b/containers/ruby-2-rails-5/.devcontainer/devcontainer.json index 3eb1b4e8d1..a7cb746e6c 100644 --- a/containers/ruby-2-rails-5/.devcontainer/devcontainer.json +++ b/containers/ruby-2-rails-5/.devcontainer/devcontainer.json @@ -1,13 +1,17 @@ { "name": "Ruby 2 Rails", "dockerFile": "Dockerfile", - "extensions": [ - "rebornix.Ruby", - ], - "runArgs": [], + // Uncomment the next line if you want to publish any ports. // "appPort": ["80:80"], + // Uncomment the next line if you want to add in default container specific settings.json values + // "settings": { "workbench.colorTheme": "Quiet Light" }, + // Uncomment the next line to run commands after the container is created. - // "postCreateCommand": "cd ${input:projectName} && bundle install" + // "postCreateCommand": "cd ${input:projectName} && bundle install", + + "extensions": [ + "rebornix.Ruby", + ] } \ No newline at end of file diff --git a/containers/ruby-2-sinatra/.devcontainer/devcontainer.json b/containers/ruby-2-sinatra/.devcontainer/devcontainer.json index 4aa1a312e1..f693b77ebc 100644 --- a/containers/ruby-2-sinatra/.devcontainer/devcontainer.json +++ b/containers/ruby-2-sinatra/.devcontainer/devcontainer.json @@ -1,14 +1,17 @@ { "name": "Ruby 2 Sinatra", "dockerFile": "Dockerfile", - "extensions": [ - "rebornix.Ruby" - ], // Uncomment and edit the next line if you want to publish any ports. // "appPort": ["4567:4567"] + // Uncomment the next line if you want to add in default container specific settings.json values + // "settings": { "workbench.colorTheme": "Quiet Light" }, + // Uncomment the next line to run commands after the container is created. - // "postCreateCommand": "" + // "postCreateCommand": "", + "extensions": [ + "rebornix.Ruby" + ] } \ No newline at end of file From 1ccd64a08c5425da2cb0f60f638401c7777ca3fd Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 11 Jun 2019 20:03:41 -0700 Subject: [PATCH 12/19] Add Docker Compose --- containers/azure-terraform/.devcontainer/Dockerfile | 4 ++-- .../docker-in-docker-compose/.devcontainer/Dockerfile | 11 +++++++++++ containers/docker-in-docker-compose/README.md | 4 ++++ containers/docker-in-docker/.devcontainer/Dockerfile | 7 ++++++- containers/docker-in-docker/README.md | 5 ++++- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/containers/azure-terraform/.devcontainer/Dockerfile b/containers/azure-terraform/.devcontainer/Dockerfile index 6a9253dbaa..326a89041f 100644 --- a/containers/azure-terraform/.devcontainer/Dockerfile +++ b/containers/azure-terraform/.devcontainer/Dockerfile @@ -11,8 +11,8 @@ ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash rather than sh ENV SHELL /bin/bash # Terraform and tflint versions -ENV TERRAFORM_VERSION=0.11.13 -ENV TFLINT_VERSION=0.7.5 +ARG TERRAFORM_VERSION=0.11.13 +ARG TFLINT_VERSION=0.7.5 # Configure apt and install packages RUN apt-get update \ diff --git a/containers/docker-in-docker-compose/.devcontainer/Dockerfile b/containers/docker-in-docker-compose/.devcontainer/Dockerfile index 2cb5b3aafa..30c2c4e23a 100644 --- a/containers/docker-in-docker-compose/.devcontainer/Dockerfile +++ b/containers/docker-in-docker-compose/.devcontainer/Dockerfile @@ -6,6 +6,13 @@ # Note: You can use any Debian/Ubuntu based image you want. FROM debian:9 +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Set the default shell to bash rather than sh +ENV SHELL /bin/bash +# Docker Compose version +ARG COMPOSE_VERSION=1.24.0 + # Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ @@ -20,6 +27,10 @@ RUN apt-get update \ && apt-get update \ && apt-get install -y docker-ce-cli \ # + # Install Docker Compose + && curl -sSL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/docker-compose \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ diff --git a/containers/docker-in-docker-compose/README.md b/containers/docker-in-docker-compose/README.md index c3af5580fa..d1534800d9 100644 --- a/containers/docker-in-docker-compose/README.md +++ b/containers/docker-in-docker-compose/README.md @@ -30,6 +30,10 @@ You can adapt your own existing development container Docker Compose setup to su && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ && apt-get install -y docker-ce-cli + # + # Install Docker Compose + && curl -sSL "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/docker-compose ``` 2. Then just forward the Docker socket by mounting it in the container in your Docker Compose config. From `.devcontainer/docker-compose.yml`: diff --git a/containers/docker-in-docker/.devcontainer/Dockerfile b/containers/docker-in-docker/.devcontainer/Dockerfile index 6de419bd0b..920f5a0697 100644 --- a/containers/docker-in-docker/.devcontainer/Dockerfile +++ b/containers/docker-in-docker/.devcontainer/Dockerfile @@ -11,7 +11,8 @@ FROM debian:9 ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash rather than sh ENV SHELL /bin/bash - +# Docker Compose version +ARG COMPOSE_VERSION=1.24.0 # Configure apt and install packages RUN apt-get update \ @@ -27,6 +28,10 @@ RUN apt-get update \ && apt-get update \ && apt-get install -y docker-ce-cli \ # + # Install Docker Compose + && curl -sSL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/docker-compose \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ diff --git a/containers/docker-in-docker/README.md b/containers/docker-in-docker/README.md index dbc422f993..1b5d0af527 100644 --- a/containers/docker-in-docker/README.md +++ b/containers/docker-in-docker/README.md @@ -31,7 +31,10 @@ You can adapt your own existing development container Dockerfile to support this && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ && apt-get install -y docker-ce-cli - + # + # Install Docker Compose + && curl -sSL "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/docker-compose ``` 2. Then just forward the Docker socket by mounting it in the container using `runArgs`. From `.devcontainer/devcontainer.json`: From 7aabfd75db198785b8b8e8dc4c6a8d470da61a5d Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Thu, 13 Jun 2019 15:48:23 -0700 Subject: [PATCH 13/19] Switch kubernetes-helm to use curl to aquire latest kubectl https://github.com/microsoft/vscode-dev-containers/issues/79 --- containers/kubernetes-helm/.devcontainer/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/containers/kubernetes-helm/.devcontainer/Dockerfile b/containers/kubernetes-helm/.devcontainer/Dockerfile index 04046477d5..1fff23edfd 100644 --- a/containers/kubernetes-helm/.devcontainer/Dockerfile +++ b/containers/kubernetes-helm/.devcontainer/Dockerfile @@ -26,10 +26,8 @@ RUN apt-get update \ && apt-get install -y docker-ce-cli \ # # Install kubectl - && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ - && echo "deb https://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/kubernetes.list \ - && apt-get update \ - && apt-get install -y kubectl \ + && curl -sSLO -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \ + && chmod +x /usr/local/bin/kubectl \ # # Install Helm && curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash - \ From b8831f7c3e0ffe0a3d231d2341b3e389ad227213 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Thu, 13 Jun 2019 15:49:38 -0700 Subject: [PATCH 14/19] Clarify reason for blank file in python containers https://github.com/microsoft/vscode-dev-containers/issues/67 --- containers/python-2/.devcontainer/Dockerfile | 10 +++++++++- containers/python-2/.devcontainer/devcontainer.json | 7 ++++--- containers/python-2/.devcontainer/noop.txt | 3 +++ containers/python-3-anaconda/.devcontainer/Dockerfile | 8 ++++++++ .../python-3-anaconda/.devcontainer/devcontainer.json | 4 +--- containers/python-3-anaconda/.devcontainer/noop.txt | 3 +++ containers/python-3-miniconda/.devcontainer/Dockerfile | 8 ++++++++ .../python-3-miniconda/.devcontainer/devcontainer.json | 4 +--- containers/python-3-miniconda/.devcontainer/noop.txt | 3 +++ containers/python-3-miniconda/environment.yml | 3 ++- containers/python-3-postgres/.devcontainer/Dockerfile | 10 +++++++++- .../python-3-postgres/.devcontainer/devcontainer.json | 4 +--- containers/python-3-postgres/.devcontainer/noop.txt | 3 +++ containers/python-3/.devcontainer/Dockerfile | 8 ++++++++ containers/python-3/.devcontainer/devcontainer.json | 4 +--- containers/python-3/.devcontainer/noop.txt | 3 +++ 16 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 containers/python-2/.devcontainer/noop.txt create mode 100644 containers/python-3-anaconda/.devcontainer/noop.txt create mode 100644 containers/python-3-miniconda/.devcontainer/noop.txt create mode 100644 containers/python-3-postgres/.devcontainer/noop.txt create mode 100644 containers/python-3/.devcontainer/noop.txt diff --git a/containers/python-2/.devcontainer/Dockerfile b/containers/python-2/.devcontainer/Dockerfile index efd867c496..d456d6a7f5 100644 --- a/containers/python-2/.devcontainer/Dockerfile +++ b/containers/python-2/.devcontainer/Dockerfile @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash rather than sh ENV SHELL /bin/bash +# Copy requirements.txt (if found) to a temp locaition so we can install it. Also +# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists. +COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/ + # Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ @@ -20,10 +24,14 @@ RUN apt-get update \ # Install pylint && pip install pylint \ # + # Update Python environment based on requirements.txt (if presenet) + && if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \ + && rm -rf /tmp/pip-tmp \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* # Switch back to dialog for any ad-hoc use of apt-get -ENV DEBIAN_FRONTEND=dialog +ENV DEBIAN_FRONTEND=dialog \ No newline at end of file diff --git a/containers/python-2/.devcontainer/devcontainer.json b/containers/python-2/.devcontainer/devcontainer.json index ad5a761718..cf4a63e84b 100644 --- a/containers/python-2/.devcontainer/devcontainer.json +++ b/containers/python-2/.devcontainer/devcontainer.json @@ -6,6 +6,9 @@ // Uncomment the next line if you want to publish any ports. // "appPort": [], + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "java -version", + "extensions": [ "ms-python.python" ], @@ -13,7 +16,5 @@ "python.pythonPath": "/usr/local/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - }, - // Install contents of requirements.txt if present - "postCreateCommand": "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi" + } } diff --git a/containers/python-2/.devcontainer/noop.txt b/containers/python-2/.devcontainer/noop.txt new file mode 100644 index 0000000000..104869adf7 --- /dev/null +++ b/containers/python-2/.devcontainer/noop.txt @@ -0,0 +1,3 @@ +This file copied into the container along with requirements.txt* from the parent +folder. This file is included to prevents the Dockerfile COPY instruction from +failing if no requirements.txt is found. \ No newline at end of file diff --git a/containers/python-3-anaconda/.devcontainer/Dockerfile b/containers/python-3-anaconda/.devcontainer/Dockerfile index 02a5627ab5..c1434edc00 100644 --- a/containers/python-3-anaconda/.devcontainer/Dockerfile +++ b/containers/python-3-anaconda/.devcontainer/Dockerfile @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash rather than sh ENV SHELL /bin/bash +# Copy environment.yml (if found) to a temp locaition so we update the environment. Also +# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists. +COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/ + # Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ @@ -20,6 +24,10 @@ RUN apt-get update \ # Install pylint && pip install pylint \ # + # Update Python environment based on environment.yml (if presenet) + && if [ -f "/tmp/conda-tmp/environment.yml" ]; then conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \ + && rm -rf /tmp/conda-tmp \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ diff --git a/containers/python-3-anaconda/.devcontainer/devcontainer.json b/containers/python-3-anaconda/.devcontainer/devcontainer.json index 4e98fd43d4..06e70c4fec 100644 --- a/containers/python-3-anaconda/.devcontainer/devcontainer.json +++ b/containers/python-3-anaconda/.devcontainer/devcontainer.json @@ -16,7 +16,5 @@ "python.pythonPath": "/opt/conda/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - }, - // Install contents of environment.yml if present - "postCreateCommand": "if [ -f environment.yml ]; then conda env update base -f environment.yml; fi" + } } \ No newline at end of file diff --git a/containers/python-3-anaconda/.devcontainer/noop.txt b/containers/python-3-anaconda/.devcontainer/noop.txt new file mode 100644 index 0000000000..dde8dc3c10 --- /dev/null +++ b/containers/python-3-anaconda/.devcontainer/noop.txt @@ -0,0 +1,3 @@ +This file copied into the container along with environment.yml* from the parent +folder. This file is included to prevents the Dockerfile COPY instruction from +failing if no environment.yml is found. \ No newline at end of file diff --git a/containers/python-3-miniconda/.devcontainer/Dockerfile b/containers/python-3-miniconda/.devcontainer/Dockerfile index 1f8b5c3398..f063010d59 100644 --- a/containers/python-3-miniconda/.devcontainer/Dockerfile +++ b/containers/python-3-miniconda/.devcontainer/Dockerfile @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash rather than sh ENV SHELL /bin/bash +# Copy environment.yml (if found) to a temp locaition so we update the environment. Also +# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists. +COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/ + # Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ @@ -20,6 +24,10 @@ RUN apt-get update \ # Install pylint && pip install pylint \ # + # Update Python environment based on environment.yml (if presenet) + && if [ -f "/tmp/conda-tmp/environment.yml" ]; then conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \ + && rm -rf /tmp/conda-tmp \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ diff --git a/containers/python-3-miniconda/.devcontainer/devcontainer.json b/containers/python-3-miniconda/.devcontainer/devcontainer.json index e780e37ed1..1cdba66fd1 100644 --- a/containers/python-3-miniconda/.devcontainer/devcontainer.json +++ b/containers/python-3-miniconda/.devcontainer/devcontainer.json @@ -16,7 +16,5 @@ "python.pythonPath": "/opt/conda/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - }, - // Install contents of environment.yml if present - "postCreateCommand": "if [ -f environment.yml ]; then conda env update base -f environment.yml; fi" + } } \ No newline at end of file diff --git a/containers/python-3-miniconda/.devcontainer/noop.txt b/containers/python-3-miniconda/.devcontainer/noop.txt new file mode 100644 index 0000000000..dde8dc3c10 --- /dev/null +++ b/containers/python-3-miniconda/.devcontainer/noop.txt @@ -0,0 +1,3 @@ +This file copied into the container along with environment.yml* from the parent +folder. This file is included to prevents the Dockerfile COPY instruction from +failing if no environment.yml is found. \ No newline at end of file diff --git a/containers/python-3-miniconda/environment.yml b/containers/python-3-miniconda/environment.yml index e83fd27b0d..443ffa3151 100644 --- a/containers/python-3-miniconda/environment.yml +++ b/containers/python-3-miniconda/environment.yml @@ -1,4 +1,5 @@ dependencies: - jupyter - numpy - - matplotlib \ No newline at end of file + - matplotlib + \ No newline at end of file diff --git a/containers/python-3-postgres/.devcontainer/Dockerfile b/containers/python-3-postgres/.devcontainer/Dockerfile index 3913ae8f7b..3a71ce7117 100644 --- a/containers/python-3-postgres/.devcontainer/Dockerfile +++ b/containers/python-3-postgres/.devcontainer/Dockerfile @@ -12,6 +12,10 @@ ENV SHELL /bin/bash ENV PYTHONUNBUFFERED 1 +# Copy requirements.txt (if found) to a temp locaition so we can install it. Also +# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists. +COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/ + # Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ @@ -22,10 +26,14 @@ RUN apt-get update \ # Install pylint && pip install pylint \ # + # Update Python environment based on requirements.txt (if presenet) + && if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \ + && rm -rf /tmp/pip-tmp \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* # Switch back to dialog for any ad-hoc use of apt-get -ENV DEBIAN_FRONTEND=dialog \ No newline at end of file +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/python-3-postgres/.devcontainer/devcontainer.json b/containers/python-3-postgres/.devcontainer/devcontainer.json index 79f0212d21..1e1093f169 100644 --- a/containers/python-3-postgres/.devcontainer/devcontainer.json +++ b/containers/python-3-postgres/.devcontainer/devcontainer.json @@ -17,7 +17,5 @@ "python.pythonPath": "/usr/local/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - }, - // Install contents of environment.yml if present - "postCreateCommand": "if [ -f environment.yml ]; conda env update base -f environment.yml; fi" + } } \ No newline at end of file diff --git a/containers/python-3-postgres/.devcontainer/noop.txt b/containers/python-3-postgres/.devcontainer/noop.txt new file mode 100644 index 0000000000..104869adf7 --- /dev/null +++ b/containers/python-3-postgres/.devcontainer/noop.txt @@ -0,0 +1,3 @@ +This file copied into the container along with requirements.txt* from the parent +folder. This file is included to prevents the Dockerfile COPY instruction from +failing if no requirements.txt is found. \ No newline at end of file diff --git a/containers/python-3/.devcontainer/Dockerfile b/containers/python-3/.devcontainer/Dockerfile index 9d86501bc1..89fcabea2e 100644 --- a/containers/python-3/.devcontainer/Dockerfile +++ b/containers/python-3/.devcontainer/Dockerfile @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive # Set the default shell to bash rather than sh ENV SHELL /bin/bash +# Copy requirements.txt (if found) to a temp locaition so we can install it. Also +# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists. +COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/ + # Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ @@ -20,6 +24,10 @@ RUN apt-get update \ # Install pylint && pip install pylint \ # + # Update Python environment based on requirements.txt (if presenet) + && if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \ + && rm -rf /tmp/pip-tmp \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ diff --git a/containers/python-3/.devcontainer/devcontainer.json b/containers/python-3/.devcontainer/devcontainer.json index 829dafa7c0..98c3287494 100644 --- a/containers/python-3/.devcontainer/devcontainer.json +++ b/containers/python-3/.devcontainer/devcontainer.json @@ -16,7 +16,5 @@ "python.pythonPath": "/usr/local/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true - }, - // Install contents of requirements.txt if present - "postCreateCommand": "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi" + } } \ No newline at end of file diff --git a/containers/python-3/.devcontainer/noop.txt b/containers/python-3/.devcontainer/noop.txt new file mode 100644 index 0000000000..104869adf7 --- /dev/null +++ b/containers/python-3/.devcontainer/noop.txt @@ -0,0 +1,3 @@ +This file copied into the container along with requirements.txt* from the parent +folder. This file is included to prevents the Dockerfile COPY instruction from +failing if no requirements.txt is found. \ No newline at end of file From 7c4aa814282c3902b74050bd02cb21263e9de2db Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Thu, 13 Jun 2019 16:02:42 -0700 Subject: [PATCH 15/19] Adjust TS/JS dockerfiles to match others --- .../.devcontainer/Dockerfile | 41 ++++++++++--------- .../.devcontainer/Dockerfile | 41 ++++++++++--------- .../.devcontainer/Dockerfile | 20 +++++++-- .../.devcontainer/Dockerfile | 11 +++-- .../.devcontainer/Dockerfile | 11 +++-- 5 files changed, 77 insertions(+), 47 deletions(-) diff --git a/containers/javascript-node-8/.devcontainer/Dockerfile b/containers/javascript-node-8/.devcontainer/Dockerfile index 680e08959d..6249ed179f 100644 --- a/containers/javascript-node-8/.devcontainer/Dockerfile +++ b/containers/javascript-node-8/.devcontainer/Dockerfile @@ -5,33 +5,36 @@ FROM node:8 -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Verify git and needed tools are installed -RUN apt-get install -y git procps +# Set the default shell to bash instead of sh +ENV SHELL /bin/bash -# Remove outdated yarn from /opt and install via package -# so it can be easily updated via apt-get upgrade yarn -RUN rm -rf /opt/yarn-* \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get install -y git procps \ + # + # Remove outdated yarn from /opt and install via package + # so it can be easily updated via apt-get upgrade yarn + && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ && apt-get install -y curl apt-transport-https lsb-release \ && curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ - && apt-get -y install --no-install-recommends yarn - -# Install eslint -RUN npm install -g eslint - -# Clean up -RUN apt-get autoremove -y \ + && apt-get -y install --no-install-recommends yarn \ + # + # Install eslint globally + && npm install -g eslint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/javascript-node-lts-mongo/.devcontainer/Dockerfile b/containers/javascript-node-lts-mongo/.devcontainer/Dockerfile index aeb0fe0023..3507829be2 100644 --- a/containers/javascript-node-lts-mongo/.devcontainer/Dockerfile +++ b/containers/javascript-node-lts-mongo/.devcontainer/Dockerfile @@ -5,33 +5,36 @@ FROM node:lts -# Configure apt +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 - -# Verify git and process tools are installed -RUN apt-get install -y git procps +# Set the default shell to bash instead of sh +ENV SHELL /bin/bash -# Remove outdated yarn from /opt and install via package -# so it can be easily updated via apt-get upgrade yarn -RUN rm -rf /opt/yarn-* \ +# Configure apt and install packages +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed + && apt-get install -y git procps \ + # + # Remove outdated yarn from /opt and install via package + # so it can be easily updated via apt-get upgrade yarn + && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ && apt-get install -y curl apt-transport-https lsb-release \ && curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ - && apt-get -y install --no-install-recommends yarn - -# Install eslint -RUN npm install -g eslint - -# Clean up -RUN apt-get autoremove -y \ + && apt-get -y install --no-install-recommends yarn \ + # + # Install eslint globally + && npm install -g eslint \ + # + # Clean up + && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog -# Set the default shell to bash instead of sh -ENV SHELL /bin/bash \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/javascript-node-lts/.devcontainer/Dockerfile b/containers/javascript-node-lts/.devcontainer/Dockerfile index 4c26e27f87..3507829be2 100644 --- a/containers/javascript-node-lts/.devcontainer/Dockerfile +++ b/containers/javascript-node-lts/.devcontainer/Dockerfile @@ -5,13 +5,20 @@ FROM node:lts +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive -ENV DEBIAN_FRONTEND=dialog +# Set the default shell to bash instead of sh ENV SHELL /bin/bash +# Configure apt and install packages RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # + # Verify git and needed tools are installed && apt-get install -y git procps \ + # + # Remove outdated yarn from /opt and install via package + # so it can be easily updated via apt-get upgrade yarn && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ @@ -20,7 +27,14 @@ RUN apt-get update \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && apt-get -y install --no-install-recommends yarn \ + # + # Install eslint globally && npm install -g eslint \ + # + # Clean up && apt-get autoremove -y \ && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/lib/apt/lists/* + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/typescript-node-8/.devcontainer/Dockerfile b/containers/typescript-node-8/.devcontainer/Dockerfile index 0142f7a461..053777b266 100644 --- a/containers/typescript-node-8/.devcontainer/Dockerfile +++ b/containers/typescript-node-8/.devcontainer/Dockerfile @@ -5,16 +5,18 @@ FROM node:8 +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive - # Set the default shell to bash instead of sh ENV SHELL /bin/bash -# Configure apt +# Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # # Verify git and needed tools are installed && apt-get install -y git procps \ + # # Remove outdated yarn from /opt and install via package # so it can be easily updated via apt-get upgrade yarn && rm -rf /opt/yarn-* \ @@ -25,11 +27,14 @@ RUN apt-get update \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && apt-get -y install --no-install-recommends yarn \ + # # Install tslint and typescript globally && npm install -g tslint typescript \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/typescript-node-lts/.devcontainer/Dockerfile b/containers/typescript-node-lts/.devcontainer/Dockerfile index 65746bd2db..ee43e665ac 100644 --- a/containers/typescript-node-lts/.devcontainer/Dockerfile +++ b/containers/typescript-node-lts/.devcontainer/Dockerfile @@ -5,16 +5,18 @@ FROM node:lts +# Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive - # Set the default shell to bash instead of sh ENV SHELL /bin/bash -# Configure apt +# Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ + # # Verify git and needed tools are installed && apt-get install -y git procps \ + # # Remove outdated yarn from /opt and install via package # so it can be easily updated via apt-get upgrade yarn && rm -rf /opt/yarn-* \ @@ -25,11 +27,14 @@ RUN apt-get update \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && apt-get -y install --no-install-recommends yarn \ + # # Install tslint and typescript globally && npm install -g tslint typescript \ + # # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -ENV DEBIAN_FRONTEND=dialog \ No newline at end of file +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog From f8926e13514d85fa31a776e77ad11539e78f2712 Mon Sep 17 00:00:00 2001 From: Brett Cannon <54418+brettcannon@users.noreply.github.com> Date: Thu, 13 Jun 2019 16:54:53 -0700 Subject: [PATCH 16/19] Fix some grammar --- containers/python-3-miniconda/.devcontainer/noop.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/containers/python-3-miniconda/.devcontainer/noop.txt b/containers/python-3-miniconda/.devcontainer/noop.txt index dde8dc3c10..82122ed266 100644 --- a/containers/python-3-miniconda/.devcontainer/noop.txt +++ b/containers/python-3-miniconda/.devcontainer/noop.txt @@ -1,3 +1,3 @@ -This file copied into the container along with environment.yml* from the parent -folder. This file is included to prevents the Dockerfile COPY instruction from -failing if no environment.yml is found. \ No newline at end of file +This file is copied into the container along with environment.yml* from the +parent folder. This is done to prevent the Dockerfile COPY instruction from +failing if no environment.yml is found. From ddadb456f0bcbac67432747ad970c5bf652da802 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Thu, 13 Jun 2019 23:59:18 +0000 Subject: [PATCH 17/19] Typos --- containers/python-2/.devcontainer/noop.txt | 4 ++-- containers/python-3-miniconda/.devcontainer/noop.txt | 2 +- containers/python-3-postgres/.devcontainer/noop.txt | 4 ++-- containers/python-3/.devcontainer/noop.txt | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/containers/python-2/.devcontainer/noop.txt b/containers/python-2/.devcontainer/noop.txt index 104869adf7..6d257995ff 100644 --- a/containers/python-2/.devcontainer/noop.txt +++ b/containers/python-2/.devcontainer/noop.txt @@ -1,3 +1,3 @@ -This file copied into the container along with requirements.txt* from the parent -folder. This file is included to prevents the Dockerfile COPY instruction from +This file is copied into the container along with requirements.txt* from the +parent folder. This is done to prevent the Dockerfile COPY instruction from failing if no requirements.txt is found. \ No newline at end of file diff --git a/containers/python-3-miniconda/.devcontainer/noop.txt b/containers/python-3-miniconda/.devcontainer/noop.txt index 82122ed266..abee195410 100644 --- a/containers/python-3-miniconda/.devcontainer/noop.txt +++ b/containers/python-3-miniconda/.devcontainer/noop.txt @@ -1,3 +1,3 @@ This file is copied into the container along with environment.yml* from the parent folder. This is done to prevent the Dockerfile COPY instruction from -failing if no environment.yml is found. +failing if no environment.yml is found. \ No newline at end of file diff --git a/containers/python-3-postgres/.devcontainer/noop.txt b/containers/python-3-postgres/.devcontainer/noop.txt index 104869adf7..6d257995ff 100644 --- a/containers/python-3-postgres/.devcontainer/noop.txt +++ b/containers/python-3-postgres/.devcontainer/noop.txt @@ -1,3 +1,3 @@ -This file copied into the container along with requirements.txt* from the parent -folder. This file is included to prevents the Dockerfile COPY instruction from +This file is copied into the container along with requirements.txt* from the +parent folder. This is done to prevent the Dockerfile COPY instruction from failing if no requirements.txt is found. \ No newline at end of file diff --git a/containers/python-3/.devcontainer/noop.txt b/containers/python-3/.devcontainer/noop.txt index 104869adf7..6d257995ff 100644 --- a/containers/python-3/.devcontainer/noop.txt +++ b/containers/python-3/.devcontainer/noop.txt @@ -1,3 +1,3 @@ -This file copied into the container along with requirements.txt* from the parent -folder. This file is included to prevents the Dockerfile COPY instruction from +This file is copied into the container along with requirements.txt* from the +parent folder. This is done to prevent the Dockerfile COPY instruction from failing if no requirements.txt is found. \ No newline at end of file From bf66dd433c303659b316db9c47af7cb4d6c6a7e9 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Fri, 14 Jun 2019 13:56:51 +0000 Subject: [PATCH 18/19] Bug fixes --- containers/docker-in-docker-compose/README.md | 5 +++- containers/docker-in-docker/README.md | 6 +++-- .../kubernetes-helm/.devcontainer/Dockerfile | 2 +- containers/kubernetes-helm/README.md | 24 +++++++++---------- .../ruby-2-rails-5/.devcontainer/Dockerfile | 13 +++++----- .../.devcontainer/devcontainer.json | 2 +- .../ruby-2-sinatra/.devcontainer/Dockerfile | 1 - 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/containers/docker-in-docker-compose/README.md b/containers/docker-in-docker-compose/README.md index d1534800d9..2e51afb032 100644 --- a/containers/docker-in-docker-compose/README.md +++ b/containers/docker-in-docker-compose/README.md @@ -25,7 +25,10 @@ You can adapt your own existing development container Docker Compose setup to su 1. First, install the Docker CLI in your dev container. From `.devcontainer/Dockerfile`: ```Dockerfile - RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ + RUN apt-get update \ + # + # Install Docker CE CLI + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ diff --git a/containers/docker-in-docker/README.md b/containers/docker-in-docker/README.md index 1b5d0af527..56205bf309 100644 --- a/containers/docker-in-docker/README.md +++ b/containers/docker-in-docker/README.md @@ -25,8 +25,10 @@ You can adapt your own existing development container Dockerfile to support this 1. First, install the Docker CLI in your container. From `.devcontainer/Dockerfile`: ```Dockerfile - # Install Docker CE CLI - RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ + RUN apt-get update \ + # + # Install Docker CE CLI + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ diff --git a/containers/kubernetes-helm/.devcontainer/Dockerfile b/containers/kubernetes-helm/.devcontainer/Dockerfile index 1fff23edfd..1698b20c42 100644 --- a/containers/kubernetes-helm/.devcontainer/Dockerfile +++ b/containers/kubernetes-helm/.devcontainer/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get update \ && apt-get install -y docker-ce-cli \ # # Install kubectl - && curl -sSLO -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \ + && curl -sSL -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \ && chmod +x /usr/local/bin/kubectl \ # # Install Helm diff --git a/containers/kubernetes-helm/README.md b/containers/kubernetes-helm/README.md index 3d14c00f9e..857315d76c 100644 --- a/containers/kubernetes-helm/README.md +++ b/containers/kubernetes-helm/README.md @@ -76,21 +76,21 @@ You can adapt your own existing development container Dockerfile to support this 4. Finally, update your Dockerfile to install all of the needed CLIs in the container. From `.devcontainer/Dockerfile`: ```Dockerfile - # Install Docker CE CLI - RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ + RUN apt-get update \ + # + # Install Docker CE CLI + && apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \ && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-ce-cli - - # Install kubectl - RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - 2>/dev/null \ - && echo "deb https://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/kubernetes.list \ - && apt-get update \ - && apt-get install -y kubectl - - # Install Helm - RUN curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash - + && apt-get install -y docker-ce-cli \ + # + # Install kubectl + && curl -sSL -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \ + && chmod +x /usr/local/bin/kubectl \ + # + # Install Helm + curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash - ``` 5. Press F1 and run **Remote-Containers: Rebuild Container** so the changes take effect. diff --git a/containers/ruby-2-rails-5/.devcontainer/Dockerfile b/containers/ruby-2-rails-5/.devcontainer/Dockerfile index 867fae0678..d64d633536 100644 --- a/containers/ruby-2-rails-5/.devcontainer/Dockerfile +++ b/containers/ruby-2-rails-5/.devcontainer/Dockerfile @@ -10,13 +10,12 @@ RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ # # Install vim, git, process tools, lsb-release - RUN apt-get update \ - && apt-get install -y \ - vim \ - git \ - procps \ - lsb-release \ - # + && apt-get install -y \ + vim \ + git \ + procps \ + lsb-release \ +# # Install ruby && apt-get install -y \ ruby \ diff --git a/containers/ruby-2-rails-5/.devcontainer/devcontainer.json b/containers/ruby-2-rails-5/.devcontainer/devcontainer.json index a7cb746e6c..60e217ae8f 100644 --- a/containers/ruby-2-rails-5/.devcontainer/devcontainer.json +++ b/containers/ruby-2-rails-5/.devcontainer/devcontainer.json @@ -12,6 +12,6 @@ // "postCreateCommand": "cd ${input:projectName} && bundle install", "extensions": [ - "rebornix.Ruby", + "rebornix.Ruby" ] } \ No newline at end of file diff --git a/containers/ruby-2-sinatra/.devcontainer/Dockerfile b/containers/ruby-2-sinatra/.devcontainer/Dockerfile index 3731349629..0b7bff86af 100644 --- a/containers/ruby-2-sinatra/.devcontainer/Dockerfile +++ b/containers/ruby-2-sinatra/.devcontainer/Dockerfile @@ -10,7 +10,6 @@ RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ # # Install vim, git, process tools, lsb-release - && apt-get update \ && apt-get install -y \ vim \ git \ From 943a66a5dc4e8cfe431cdf49d65c36542749a485 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Fri, 14 Jun 2019 13:59:42 +0000 Subject: [PATCH 19/19] Typo --- containers/ruby-2-rails-5/.devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/ruby-2-rails-5/.devcontainer/Dockerfile b/containers/ruby-2-rails-5/.devcontainer/Dockerfile index d64d633536..a5bcdc3da4 100644 --- a/containers/ruby-2-rails-5/.devcontainer/Dockerfile +++ b/containers/ruby-2-rails-5/.devcontainer/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update \ git \ procps \ lsb-release \ -# + # # Install ruby && apt-get install -y \ ruby \