Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Update yarn using package, clean out outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Apr 19, 2019
1 parent 5afc842 commit d2de37d
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 66 deletions.
36 changes: 23 additions & 13 deletions containers/azure-functions-node-8/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,46 @@

FROM mcr.microsoft.com/dotnet/core/sdk:2.1

# 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 update && apt-get -y install git curl tar procps
RUN apt-get -y install \
git \
procps \
curl \
apt-transport-https \
gnupg2 \
lsb-release

# Install Node.js via NVM - See https://github.com/creationix/nvm
# Change the number "8" in the two lines below to pick a different version
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
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 \
&& nvm install 8 \
&& nvm alias default 8"
&& nvm install --no-progress 8 \
&& nvm alias default 8" 2>&1

# Install eslint
RUN /bin/bash -c "source $HOME/.nvm/nvm.sh && npm install -g eslint"

# Install latest yarn
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
&& rm -rf /opt/yarn-* \
&& tar -xzf latest.tar.gz -C /opt/ \
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm latest.tar.gz
RUN 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 Azure Functions and Azure CLI
RUN 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 \
RUN 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 -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \
&& apt-get update \
&& apt-get install -y azure-cli azure-functions-core-tools

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

40 changes: 25 additions & 15 deletions containers/azure-functions-node-lts/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,46 @@

FROM mcr.microsoft.com/dotnet/core/sdk:2.1

# 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 update && apt-get -y install git curl tar procps
RUN apt-get -y install \
git \
procps \
curl \
apt-transport-https \
gnupg2 \
lsb-release

# Install Node.js via NVM - See https://github.com/creationix/nvm
# Install Node.js via NVM - See https://github.com/creationix/nvm
# Change the "lts/*" in the two lines below to pick a different version
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
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 \
&& nvm install lts/* \
&& nvm alias default lts/*"
&& nvm install --no-progress lts/* \
&& nvm alias default lts/*" 2>&1

# Install eslint
RUN /bin/bash -c "source $HOME/.nvm/nvm.sh && npm install -g eslint"

# Install latest yarn
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
&& rm -rf /opt/yarn-* \
&& tar -xzf latest.tar.gz -C /opt/ \
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm latest.tar.gz
RUN 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 Azure Functions and Azure CLI
RUN 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 \
RUN 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 -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \
&& apt-get update \
&& apt-get install -y azure-cli azure-functions-core-tools

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

20 changes: 11 additions & 9 deletions containers/javascript-node-8/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ 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 curl tar procps
RUN apt-get install -y git procps

# Update Yarn to latest
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
&& rm -rf /opt/yarn-* \
&& tar -xzf latest.tar.gz -C /opt/ \
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm latest.tar.gz
# 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-* \
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
Expand Down
12 changes: 10 additions & 2 deletions containers/javascript-node-lts-mongo/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ RUN apt-get update \
# Verify git and process tools are installed
RUN apt-get install -y git procps

# Update yarn
RUN npm install -g yarn
# 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-* \
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
Expand Down
20 changes: 11 additions & 9 deletions containers/javascript-node-lts/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ 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 curl tar procps
RUN apt-get install -y git procps

# Update Yarn to latest
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
&& rm -rf /opt/yarn-* \
&& tar -xzf latest.tar.gz -C /opt/ \
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm latest.tar.gz
# 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-* \
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
Expand Down
20 changes: 11 additions & 9 deletions containers/typescript-node-8/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ 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 curl tar procps
RUN apt-get install -y git procps

# Update Yarn to latest
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
&& rm -rf /opt/yarn-* \
&& tar -xzf latest.tar.gz -C /opt/ \
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm latest.tar.gz
# 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-* \
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
Expand Down
20 changes: 11 additions & 9 deletions containers/typescript-node-lts/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ 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 curl tar procps
RUN apt-get install -y git procps

# Update Yarn to latest
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
&& rm -rf /opt/yarn-* \
&& tar -xzf latest.tar.gz -C /opt/ \
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm latest.tar.gz
# 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-* \
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
Expand Down

0 comments on commit d2de37d

Please sign in to comment.