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

Commit d2de37d

Browse files
committed
Update yarn using package, clean out outdated
1 parent 5afc842 commit d2de37d

File tree

7 files changed

+102
-66
lines changed

7 files changed

+102
-66
lines changed

containers/azure-functions-node-8/.devcontainer/Dockerfile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,46 @@
55

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

8+
# Configure apt
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
RUN apt-get update \
11+
&& apt-get -y install --no-install-recommends apt-utils 2>&1
12+
813
# Verify git and needed tools are installed
9-
RUN apt-get update && apt-get -y install git curl tar procps
14+
RUN apt-get -y install \
15+
git \
16+
procps \
17+
curl \
18+
apt-transport-https \
19+
gnupg2 \
20+
lsb-release
1021

1122
# Install Node.js via NVM - See https://github.com/creationix/nvm
1223
# Change the number "8" in the two lines below to pick a different version
13-
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
24+
RUN curl -so- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash 2>&1 \
1425
&& /bin/bash -c "source $HOME/.nvm/nvm.sh \
15-
&& nvm install 8 \
16-
&& nvm alias default 8"
26+
&& nvm install --no-progress 8 \
27+
&& nvm alias default 8" 2>&1
1728

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

2132
# Install latest yarn
22-
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
23-
&& rm -rf /opt/yarn-* \
24-
&& tar -xzf latest.tar.gz -C /opt/ \
25-
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
26-
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
27-
&& rm latest.tar.gz
33+
RUN curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
34+
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
35+
&& apt-get update \
36+
&& apt-get -y install --no-install-recommends yarn
2837

2938
# Install Azure Functions and Azure CLI
30-
RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \
31-
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
39+
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
3240
&& 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 \
33-
&& curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
41+
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \
3442
&& apt-get update \
3543
&& apt-get install -y azure-cli azure-functions-core-tools
3644

3745
# Clean up
3846
RUN apt-get autoremove -y \
3947
&& apt-get clean -y \
4048
&& rm -rf /var/lib/apt/lists/*
49+
ENV DEBIAN_FRONTEND=dialog
50+

containers/azure-functions-node-lts/.devcontainer/Dockerfile

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,46 @@
55

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

8+
# Configure apt
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
RUN apt-get update \
11+
&& apt-get -y install --no-install-recommends apt-utils 2>&1
12+
813
# Verify git and needed tools are installed
9-
RUN apt-get update && apt-get -y install git curl tar procps
14+
RUN apt-get -y install \
15+
git \
16+
procps \
17+
curl \
18+
apt-transport-https \
19+
gnupg2 \
20+
lsb-release
1021

11-
# Install Node.js via NVM - See https://github.com/creationix/nvm
22+
# Install Node.js via NVM - See https://github.com/creationix/nvm
1223
# Change the "lts/*" in the two lines below to pick a different version
13-
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash \
24+
RUN curl -so- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash 2>&1 \
1425
&& /bin/bash -c "source $HOME/.nvm/nvm.sh \
15-
&& nvm install lts/* \
16-
&& nvm alias default lts/*"
26+
&& nvm install --no-progress lts/* \
27+
&& nvm alias default lts/*" 2>&1
1728

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

2132
# Install latest yarn
22-
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
23-
&& rm -rf /opt/yarn-* \
24-
&& tar -xzf latest.tar.gz -C /opt/ \
25-
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
26-
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
27-
&& rm latest.tar.gz
33+
RUN curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
34+
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
35+
&& apt-get update \
36+
&& apt-get -y install --no-install-recommends yarn
2837

2938
# Install Azure Functions and Azure CLI
30-
RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \
31-
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
39+
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
3240
&& 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 \
33-
&& curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
41+
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 2>/dev/null \
3442
&& apt-get update \
3543
&& apt-get install -y azure-cli azure-functions-core-tools
36-
44+
3745
# Clean up
3846
RUN apt-get autoremove -y \
3947
&& apt-get clean -y \
4048
&& rm -rf /var/lib/apt/lists/*
49+
ENV DEBIAN_FRONTEND=dialog
50+

containers/javascript-node-8/.devcontainer/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ RUN apt-get update \
1111
&& apt-get -y install --no-install-recommends apt-utils 2>&1
1212

1313
# Verify git and needed tools are installed
14-
RUN apt-get install -y git curl tar procps
14+
RUN apt-get install -y git procps
1515

16-
# Update Yarn to latest
17-
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
18-
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
19-
&& rm -rf /opt/yarn-* \
20-
&& tar -xzf latest.tar.gz -C /opt/ \
21-
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
22-
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
23-
&& rm latest.tar.gz
16+
# Remove outdated yarn from /opt and install via package
17+
# so it can be easily updated via apt-get upgrade yarn
18+
RUN rm -rf /opt/yarn-* \
19+
rm -f /usr/local/bin/yarn \
20+
rm -f /usr/local/bin/yarnpkg \
21+
&& apt-get install -y curl apt-transport-https lsb-release \
22+
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
23+
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
24+
&& apt-get update \
25+
&& apt-get -y install --no-install-recommends yarn
2426

2527
# Install eslint
2628
RUN npm install -g eslint

containers/javascript-node-lts-mongo/.devcontainer/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ RUN apt-get update \
1313
# Verify git and process tools are installed
1414
RUN apt-get install -y git procps
1515

16-
# Update yarn
17-
RUN npm install -g yarn
16+
# Remove outdated yarn from /opt and install via package
17+
# so it can be easily updated via apt-get upgrade yarn
18+
RUN rm -rf /opt/yarn-* \
19+
rm -f /usr/local/bin/yarn \
20+
rm -f /usr/local/bin/yarnpkg \
21+
&& apt-get install -y curl apt-transport-https lsb-release \
22+
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
23+
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
24+
&& apt-get update \
25+
&& apt-get -y install --no-install-recommends yarn
1826

1927
# Install eslint
2028
RUN npm install -g eslint

containers/javascript-node-lts/.devcontainer/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ RUN apt-get update \
1111
&& apt-get -y install --no-install-recommends apt-utils 2>&1
1212

1313
# Verify git and needed tools are installed
14-
RUN apt-get install -y git curl tar procps
14+
RUN apt-get install -y git procps
1515

16-
# Update Yarn to latest
17-
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
18-
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
19-
&& rm -rf /opt/yarn-* \
20-
&& tar -xzf latest.tar.gz -C /opt/ \
21-
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
22-
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
23-
&& rm latest.tar.gz
16+
# Remove outdated yarn from /opt and install via package
17+
# so it can be easily updated via apt-get upgrade yarn
18+
RUN rm -rf /opt/yarn-* \
19+
rm -f /usr/local/bin/yarn \
20+
rm -f /usr/local/bin/yarnpkg \
21+
&& apt-get install -y curl apt-transport-https lsb-release \
22+
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
23+
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
24+
&& apt-get update \
25+
&& apt-get -y install --no-install-recommends yarn
2426

2527
# Install eslint
2628
RUN npm install -g eslint

containers/typescript-node-8/.devcontainer/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ RUN apt-get update \
1111
&& apt-get -y install --no-install-recommends apt-utils 2>&1
1212

1313
# Verify git and needed tools are installed
14-
RUN apt-get install -y git curl tar procps
14+
RUN apt-get install -y git procps
1515

16-
# Update Yarn to latest
17-
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
18-
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
19-
&& rm -rf /opt/yarn-* \
20-
&& tar -xzf latest.tar.gz -C /opt/ \
21-
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
22-
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
23-
&& rm latest.tar.gz
16+
# Remove outdated yarn from /opt and install via package
17+
# so it can be easily updated via apt-get upgrade yarn
18+
RUN rm -rf /opt/yarn-* \
19+
rm -f /usr/local/bin/yarn \
20+
rm -f /usr/local/bin/yarnpkg \
21+
&& apt-get install -y curl apt-transport-https lsb-release \
22+
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
23+
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
24+
&& apt-get update \
25+
&& apt-get -y install --no-install-recommends yarn
2426

2527
# Install tslint and typescript
2628
RUN npm install -g tslint typescript

containers/typescript-node-lts/.devcontainer/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ RUN apt-get update \
1111
&& apt-get -y install --no-install-recommends apt-utils 2>&1
1212

1313
# Verify git and needed tools are installed
14-
RUN apt-get install -y git curl tar procps
14+
RUN apt-get install -y git procps
1515

16-
# Update Yarn to latest
17-
# See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn
18-
RUN curl -sfSLO --compressed "https://yarnpkg.com/latest.tar.gz" \
19-
&& rm -rf /opt/yarn-* \
20-
&& tar -xzf latest.tar.gz -C /opt/ \
21-
&& ln -snf /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
22-
&& ln -snf /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg \
23-
&& rm latest.tar.gz
16+
# Remove outdated yarn from /opt and install via package
17+
# so it can be easily updated via apt-get upgrade yarn
18+
RUN rm -rf /opt/yarn-* \
19+
rm -f /usr/local/bin/yarn \
20+
rm -f /usr/local/bin/yarnpkg \
21+
&& apt-get install -y curl apt-transport-https lsb-release \
22+
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
23+
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
24+
&& apt-get update \
25+
&& apt-get -y install --no-install-recommends yarn
2426

2527
# Install tslint and typescript
2628
RUN npm install -g tslint typescript

0 commit comments

Comments
 (0)