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

Commit 69b93b6

Browse files
committed
Debian as base, reduce chances of errors due to release version
1 parent 70f5e74 commit 69b93b6

File tree

19 files changed

+65
-86
lines changed

19 files changed

+65
-86
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
# Licensed under the MIT License. See LICENSE in the project root for license information.
55
#-----------------------------------------------------------------------------------------
66

7-
FROM ubuntu:bionic
7+
FROM debian:9
88

99
# Install git
1010
RUN apt-get update \
1111
&& apt-get install -y git
1212

13-
# Install Docker CE CLI. If you choose a Debian based image, update https://download.docker.com/linux/ubuntu
14-
# to https://download.docker.com/linux/debian on the third line below.
13+
# Install Docker CE CLI
1514
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
16-
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
17-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
15+
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
16+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
1817
&& apt-get update \
1918
&& apt-get install -y docker-ce-cli
2019

20+
2121
# Clean up
2222
RUN apt-get autoremove -y \
2323
&& apt-get clean -y \

awk

Whitespace-only changes.

container-templates/docker-compose/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# **************************************************************************
1010

1111
# Debian and Ubuntu based images are supported. Alpine images are not yet supported.
12-
FROM ubuntu:bionic
12+
FROM debian:9
1313

1414
# Install git, process tools
1515
RUN apt-get update && apt-get -y install git procps

container-templates/dockerfile/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#-----------------------------------------------------------------------------------------
55

66
# Debian and Ubuntu based images are supported. Alpine images are not yet supported.
7-
FROM ubuntu:bionic
7+
FROM debian:9
88

99
# Install git, process tools
1010
RUN apt-get update && apt-get -y install git procps

containers/azure-machine-learning-python-3/.devcontainer/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
# Licensed under the MIT License. See LICENSE in the project root for license information.
44
#-----------------------------------------------------------------------------------------
55

6-
FROM python:3.7-slim
6+
FROM python:3
77

88
# Install git, process tools
99
RUN apt-get update && apt-get -y install git procps
1010

11-
# Install Docker CE - ** COMMENT OUT IF YOU WILL ONLY RUN LOCAL OR IN AZURE **
11+
# [Optional] Install Docker CE - Remove if you won't be doing local testing
1212
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
13-
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
14-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
13+
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
14+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
1515
&& apt-get update \
1616
&& apt-get install -y docker-ce-cli
1717

18+
1819
# Install pylint
1920
RUN pip install pylint
2021

containers/azure-terraform/.devcontainer/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh
2525
&& nvm install lts/* \
2626
&& nvm alias default lts/*"
2727

28+
# [Optional] For local testing instead of cloud shell
2829
# Install Docker CE CLI.
29-
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
30-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
30+
RUN && curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
31+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
3132
&& apt-get update \
32-
&& apt-get install -y docker-ce-cli
33+
&& apt-get install -y docker-ce-cli
3334

35+
# [Optional] For local testing instead of cloud shell
3436
# Install the Azure CLI
3537
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
3638
&& curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
@@ -39,10 +41,10 @@ RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(ls
3941

4042
# Install Terraform and tflint
4143
RUN mkdir -p /tmp/docker-downloads \
42-
&& curl -sSL -o /tmp/docker-downloads/terraform.zip https://releases.hashicorp.com/terraform/0.11.11/terraform_0.11.11_linux_amd64.zip \
44+
&& curl -sSL -o /tmp/docker-downloads/terraform.zip https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip \
4345
&& unzip /tmp/docker-downloads/terraform.zip \
4446
&& mv terraform /usr/local/bin \
45-
&& curl -sSL -o /tmp/docker-downloads/tflint.zip https://github.com/wata727/tflint/releases/download/v0.7.4/tflint_linux_amd64.zip \
47+
&& curl -sSL -o /tmp/docker-downloads/tflint.zip https://github.com/wata727/tflint/releases/download/v0.7.5/tflint_linux_amd64.zip \
4648
&& unzip /tmp/docker-downloads/tflint.zip \
4749
&& mv tflint /usr/local/bin \
4850
&& cd ~ \

containers/cpp/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See LICENSE in the project root for license information.
44
#-----------------------------------------------------------------------------------------
55

6-
FROM ubuntu:bionic
6+
FROM debian:9
77

88
# Install git, process tools
99
RUN apt-get update && apt-get -y install git procps

containers/docker-in-docker-compose/.devcontainer/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
#-----------------------------------------------------------------------------------------
55

66
# Note: You can use any Debian/Ubuntu based image you want.
7-
FROM ubuntu:bionic
7+
FROM debian:9
88

99
# Install git, process tools
1010
RUN apt-get update && apt-get -y install git procps
1111

12-
# Install Docker CE CLI. If you choose a Debian based image, update https://download.docker.com/linux/ubuntu
13-
# to https://download.docker.com/linux/debian on the third line below.
12+
# Install Docker CE CLI
1413
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
15-
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
16-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
14+
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
15+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
1716
&& apt-get update \
1817
&& apt-get install -y docker-ce-cli
1918

containers/docker-in-docker-compose/README.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,27 @@ Dev containers can be useful for all types of applications including those that
2222

2323
If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
2424

25-
No additional setup steps are required, but note that the included `.devcontainer/Dockerfile` can be altered to work with other Debian/Ubuntu-based container images such as `node` or `python`. First, update the `FROM` statement to reference the new base image. For example:
26-
2725
```Dockerfile
2826
FROM node:8
2927
```
3028

31-
Next, if you choose an image that is Debian based instead of Ubuntu, you will need to update this line...
32-
33-
```
34-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
35-
```
36-
37-
...to ...
38-
39-
```
40-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
41-
```
42-
4329
See the [Docker CE installation steps for Linux](https://docs.docker.com/install/linux/docker-ce/debian/) for details on other distributions. Note that you only need the Docker CLI in this particular case.
4430

4531
## How it works
4632

4733
The trick that makes this work is as follows:
4834

49-
1. First, install the Docker CLI in the container. From `dev-container.dockerfile`:
35+
1. First, install the Docker CLI in the container. From `.devcontainer/Dockerfile`:
5036

5137
```Dockerfile
52-
# Install Docker CE CLI
5338
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
54-
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
55-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
39+
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
40+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
5641
&& apt-get update \
5742
&& apt-get install -y docker-ce-cli
5843
```
59-
2. Then just forward the Docker socket by mounting it in the container. From `docker-compose.dev-container.yml`:
44+
45+
2. Then just forward the Docker socket by mounting it in the container. From `.devcontainer/docker-compose.yml`:
6046

6147
```yaml
6248
volumes:

containers/docker-in-docker/.devcontainer/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
#-----------------------------------------------------------------------------------------
66

77
# Note: You can use any Debian/Ubuntu based image you want.
8-
FROM ubuntu:bionic
8+
FROM debian:9
99

1010
# Install git, process tools
1111
RUN apt-get update && apt-get -y install git procps
1212

13-
# Install Docker CE CLI. If you choose a Debian based image, update https://download.docker.com/linux/ubuntu
14-
# to https://download.docker.com/linux/debian on the third line below.
13+
# Install Docker CE CLI
1514
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
16-
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
17-
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
15+
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
16+
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
1817
&& apt-get update \
1918
&& apt-get install -y docker-ce-cli
2019

0 commit comments

Comments
 (0)