Skip to content

Commit

Permalink
dev: update devcontainer config
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Feb 5, 2024
1 parent 1b4065c commit a2c3169
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
27 changes: 11 additions & 16 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM mcr.microsoft.com/vscode/devcontainers/base:1-focal
FROM mcr.microsoft.com/devcontainers/base:jammy

RUN apt update && apt install -y \
vim

# install aws
RUN apt-get update && \
apt-get install -y unzip python3-pip && \
pip3 install --no-cache-dir --upgrade awscli && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN SYSTEM_ARCH=$(uname -m) \
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-${SYSTEM_ARCH}-2.13.33.zip" -o "awscliv2.zip" \
&& unzip -qq awscliv2.zip \
&& aws/install \
&& aws --version \
&& rm -rf aws

# install terraform
ENV TERRAFORM_VERSION=1.5.1
ENV TERRAFORM_VERSION=1.6.6
ENV TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache
RUN mkdir -p $TF_PLUGIN_CACHE_DIR
RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
Expand All @@ -21,8 +25,6 @@ RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
# install tflint
RUN curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash

# install docker
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

# install node.js
ENV NODE_VERSION=18.x
Expand All @@ -32,10 +34,3 @@ RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - && \
# install typescript
RUN npm install -g typescript

# verify installs
RUN terraform --version \
&& aws --version \
&& node --version \
&& npm --version \
&& tsc --version \
&& docker --version
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Terraform",
"dockerFile": "Dockerfile",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.3.0": {},
"ghcr.io/devcontainers/features/docker-in-docker:2.8.0": {},
},
"mounts": [
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
Expand All @@ -14,7 +14,7 @@
"vscode": {
"settings": {
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "always"
},
"editor.formatOnSave": true,
"editor.formatOnType": false,
Expand All @@ -39,4 +39,4 @@
]
}
}
}
}

0 comments on commit a2c3169

Please sign in to comment.