Skip to content

Commit

Permalink
Add devcontainer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
beandrad committed Oct 9, 2020
1 parent 711a4d6 commit 94424c9
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG VARIANT="focal"

# To build without user input
ARG DEBIAN_FRONTEND=noninteractive

FROM ubuntu:${VARIANT}

ENV TERRAFORM_VERSION=0.12.29
ENV GO_VERSION=1.14.9

RUN apt-get update && apt-get install -y curl zip make gcc git

# Make shared download folder
RUN mkdir -p /tmp/docker-downloads

# Install Terraform
RUN curl -sSL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o /tmp/docker-downloads/terraform.zip \
&& unzip /tmp/docker-downloads/terraform.zip \
&& mv terraform /usr/local/bin

# Install Go into /usr/local/go
RUN curl -fsS https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz -o /tmp/docker-downloads/golang.tar.gz \
&& tar -C /usr/local -xvf /tmp/docker-downloads/golang.tar.gz

ENV PATH=$PATH:/usr/local/go/bin

# Remove shared download folder
RUN rm -rf /tmp/docker-downloads

ENV DEBIAN_FRONTEND=interactive
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.134.1/containers/ubuntu
{
"name": "Terraform Provider AzureRM",
"build": {
"dockerfile": "Dockerfile",
},
"runArgs": [
"-v",
"${env:HOME}${env:USERPROFILE}/.ssh:/root/.ssh-localhost:ro",
"--env-file", ".env.sh",
],
"postCreateCommand": "mkdir -p /root/.ssh && cp -r /root/.ssh-localhost/* /root/.ssh && chmod 700 /root/.ssh && chmod 600 /root/.ssh/*",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.go",
"streetsidesoftware.code-spell-checker",
"eamodio.gitlens",
"yzhang.markdown-all-in-one",
"davidanson.vscode-markdownlint"
]

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"

}

0 comments on commit 94424c9

Please sign in to comment.