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

Commit 1ccd64a

Browse files
committed
Add Docker Compose
1 parent d02cac8 commit 1ccd64a

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

containers/azure-terraform/.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ ENV DEBIAN_FRONTEND=noninteractive
1111
# Set the default shell to bash rather than sh
1212
ENV SHELL /bin/bash
1313
# Terraform and tflint versions
14-
ENV TERRAFORM_VERSION=0.11.13
15-
ENV TFLINT_VERSION=0.7.5
14+
ARG TERRAFORM_VERSION=0.11.13
15+
ARG TFLINT_VERSION=0.7.5
1616

1717
# Configure apt and install packages
1818
RUN apt-get update \

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
# Note: You can use any Debian/Ubuntu based image you want.
77
FROM debian:9
88

9+
# Avoid warnings by switching to noninteractive
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
# Set the default shell to bash rather than sh
12+
ENV SHELL /bin/bash
13+
# Docker Compose version
14+
ARG COMPOSE_VERSION=1.24.0
15+
916
# Configure apt and install packages
1017
RUN apt-get update \
1118
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
@@ -20,6 +27,10 @@ RUN apt-get update \
2027
&& apt-get update \
2128
&& apt-get install -y docker-ce-cli \
2229
#
30+
# Install Docker Compose
31+
&& curl -sSL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
32+
&& chmod +x /usr/local/bin/docker-compose \
33+
#
2334
# Clean up
2435
&& apt-get autoremove -y \
2536
&& apt-get clean -y \

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ You can adapt your own existing development container Docker Compose setup to su
3030
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
3131
&& apt-get update \
3232
&& apt-get install -y docker-ce-cli
33+
#
34+
# Install Docker Compose
35+
&& curl -sSL "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
36+
&& chmod +x /usr/local/bin/docker-compose
3337
```
3438

3539
2. Then just forward the Docker socket by mounting it in the container in your Docker Compose config. From `.devcontainer/docker-compose.yml`:

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ FROM debian:9
1111
ENV DEBIAN_FRONTEND=noninteractive
1212
# Set the default shell to bash rather than sh
1313
ENV SHELL /bin/bash
14-
14+
# Docker Compose version
15+
ARG COMPOSE_VERSION=1.24.0
1516

1617
# Configure apt and install packages
1718
RUN apt-get update \
@@ -27,6 +28,10 @@ RUN apt-get update \
2728
&& apt-get update \
2829
&& apt-get install -y docker-ce-cli \
2930
#
31+
# Install Docker Compose
32+
&& curl -sSL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
33+
&& chmod +x /usr/local/bin/docker-compose \
34+
#
3035
# Clean up
3136
&& apt-get autoremove -y \
3237
&& apt-get clean -y \

containers/docker-in-docker/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ You can adapt your own existing development container Dockerfile to support this
3131
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
3232
&& apt-get update \
3333
&& apt-get install -y docker-ce-cli
34-
34+
#
35+
# Install Docker Compose
36+
&& curl -sSL "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
37+
&& chmod +x /usr/local/bin/docker-compose
3538
```
3639

3740
2. Then just forward the Docker socket by mounting it in the container using `runArgs`. From `.devcontainer/devcontainer.json`:

0 commit comments

Comments
 (0)