Skip to content

Commit 86cfc61

Browse files
committed
dev: improve devcontainer experience
1 parent e779a7d commit 86cfc61

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.devcontainer/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/vscode/devcontainers/base:jammy
1+
FROM mcr.microsoft.com/devcontainers/base:jammy
22

33
# install aws
44
RUN SYSTEM_ARCH=$(uname -m) \
@@ -22,8 +22,16 @@ RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
2222
# install tflint
2323
RUN curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
2424

25-
# install docker
26-
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
25+
# install teleport tsh
26+
ENV TELEPORT_VERSION=10.3.16
27+
RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
28+
&& curl -OLk https://get.gravitational.com/teleport-v${TELEPORT_VERSION}-linux-${SYSTEM_ARCH}-bin.tar.gz \
29+
&& tar -xvf teleport-v${TELEPORT_VERSION}-linux-${SYSTEM_ARCH}-bin.tar.gz teleport/tsh teleport/tctl \
30+
&& mv teleport/tsh /usr/local/bin/tsh \
31+
&& mv teleport/tctl /usr/local/bin/tctl \
32+
&& chmod +x /usr/local/bin/tsh \
33+
&& chmod +x /usr/local/bin/tctl \
34+
&& rm -rf teleport/ teleport-*.tar.gz
2735

2836
# install pip
2937
RUN apt-get update
@@ -38,5 +46,4 @@ RUN python3 -m pip install \
3846

3947
# verify installs
4048
RUN terraform --version \
41-
&& aws --version \
42-
&& docker --version
49+
&& aws --version

.devcontainer/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
"name": "Terraform",
33
"dockerFile": "Dockerfile",
44
"features": {
5-
"ghcr.io/devcontainers/features/docker-in-docker:2.0.1": {}
5+
"ghcr.io/devcontainers/features/docker-in-docker:2.5.0": {}
66
},
77
"mounts": [
8-
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
8+
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
9+
"source=${localEnv:HOME}/.tsh,target=/home/vscode/.tsh,type=bind,consistency=cached"
910
],
1011
"containerEnv": {
1112
"TF_PLUGIN_CACHE_DIR": "${containerWorkspaceFolder}/.devcontainer/tmp/.terraform.d/"
@@ -45,4 +46,4 @@
4546
]
4647
}
4748
}
48-
}
49+
}

0 commit comments

Comments
 (0)