Skip to content

Commit 3228245

Browse files
committed
feat: Initial attempt at a devcontainer.
1 parent 5cefbd5 commit 3228245

File tree

2 files changed

+181
-0
lines changed

2 files changed

+181
-0
lines changed

.devcontainer/Dockerfile

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# syntax=docker/dockerfile:1
2+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/devcontainers/base:ubuntu AS base-builder
3+
4+
# Switch to proper Bash
5+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
6+
7+
# Informational
8+
ARG TARGETPLATFORM
9+
ARG BUILDPLATFORM
10+
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM."
11+
12+
# Environment variables
13+
ENV BASH_ENV "~/.bashrc"
14+
ENV CGO_ENABLED 0
15+
ENV CHECKPOINT_DISABLE true
16+
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/go/bin
17+
ENV PIP_ROOT_USER_ACTION ignore
18+
ENV TERRAGRUNT_SOURCE_UPDATE true
19+
ENV TF_PLUGIN_CACHE_DIR "/root/.terraform.d/plugin-cache"
20+
# ENV TZ "/usr/share/zoneinfo/Etc/UTC"
21+
22+
# Install the xz-utils package
23+
RUN apt-get -y update
24+
# RUN apt-get -y install --no-install-recommends
25+
26+
# bash \
27+
# curl \
28+
# exa \
29+
# git \
30+
# git-lfs \
31+
# go \
32+
# gofumpt \
33+
# golangci-lint \
34+
# gpg \
35+
# grype \
36+
# hadolint \
37+
# infracost \
38+
# jq \
39+
# make \
40+
# markdownlint-cli \
41+
# nodejs \
42+
# npm \
43+
# openssh-client \
44+
# python3 \
45+
# python3-dev \
46+
# shellcheck \
47+
# shfmt \
48+
# snyk-cli \
49+
# terraform-docs \
50+
# tfswitch \
51+
# tgswitch \
52+
# trivy \
53+
# tz \
54+
# tzdata \
55+
# xz \
56+
# yamllint \
57+
# zip \
58+
59+
# coreutils \
60+
# gcompat \
61+
# git \
62+
# ifupdown \
63+
# libc6-compat \
64+
# perl \
65+
# poetry \
66+
# procps \
67+
# util-linux-misc \
68+
# aws-cli
69+
# syft
70+
71+
RUN python3 -m ensurepip
72+
RUN python3 -m pip install --upgrade --no-cache-dir --no-cache --force pip
73+
RUN python3 -m pip install --upgrade --no-cache-dir --no-cache --force wheel
74+
RUN sleep 1
75+
RUN python3 -m pip install --no-cache-dir --upgrade \
76+
pre-commit \
77+
;
78+
79+
RUN mkdir -p /root/.ssh
80+
RUN ssh-keyscan -H "github.com" >> /root/.ssh/known_hosts
81+
82+
# Cleanup
83+
RUN rm -Rf /tmp/*
84+
RUN find /tmp -type f -print0 | xargs -0 rm -Rf
85+
86+
# Code mounted here
87+
WORKDIR /workspace
88+
89+
# Labels
90+
ARG BUILD_DATE
91+
ARG VCS_REF
92+
ARG VCS_TAG
93+
ARG VCS_URL
94+
95+
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
96+
LABEL org.opencontainers.image.title=""
97+
LABEL org.opencontainers.image.version="$VCS_TAG"
98+
LABEL org.opencontainers.image.description=""
99+
LABEL org.opencontainers.image.url=""
100+
LABEL org.opencontainers.image.documentation=""
101+
LABEL org.opencontainers.image.vendor=""
102+
LABEL org.opencontainers.image.authors=""
103+
LABEL org.opencontainers.image.created="$BUILD_DATE"
104+
LABEL org.opencontainers.image.source="$VCS_URL"
105+
LABEL org.opencontainers.image.revision="$VCS_REF"

.devcontainer/devcontainer.json

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"name": "Ubuntu",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {},
7+
"forwardPorts": [],
8+
"postCreateCommand": "",
9+
"remoteUser": "root",
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"akshayn.GoGet",
14+
"annsk.alignment",
15+
"AquaSecurityOfficial.trivy-vulnerability-scanner",
16+
"arr.marksman",
17+
"bierner.markdown-checkbox",
18+
"bierner.markdown-preview-github-styles",
19+
"chouzz.vscode-better-align",
20+
"christian-kohler.path-intellisense",
21+
"Cmacu.gotoanything",
22+
"codezombiech.gitignore",
23+
"darkriszty.markdown-table-prettify",
24+
"DavidAnson.vscode-markdownlint",
25+
"donjayamanne.git-extension-pack",
26+
"donjayamanne.githistory",
27+
"dt.ghlink",
28+
"eamodio.gitlens",
29+
"EditorConfig.EditorConfig",
30+
"elagil.pre-commit-helper",
31+
"exiasr.hadolint",
32+
"fcrespo82.markdown-table-formatter",
33+
"foxundermoon.shell-format",
34+
"github.vscode-github-actions",
35+
"GitHub.vscode-pull-request-github",
36+
"golang.go",
37+
"Gruntfuggly.todo-tree",
38+
"gurumukhi.selected-lines-count",
39+
"hashicorp.hcl",
40+
"hashicorp.terraform",
41+
"JFrog.jfrog-vscode-extension",
42+
"lamartire.git-indicators",
43+
"logerfo.json-trimmer",
44+
"mads-hartmann.bash-ide-vscode",
45+
"MaxMedia.go-prof",
46+
"me-dutour-mathieu.vscode-github-actions",
47+
"mhutchie.git-graph",
48+
"mkxml.vscode-filesize",
49+
"mohsen1.prettify-json",
50+
"ms-azuretools.vscode-docker",
51+
"MS-SarifVSCode.sarif-viewer",
52+
"ms-vscode.makefile-tools",
53+
"msyrus.go-doc",
54+
"nhoizey.gremlins",
55+
"oliversturm.fix-json",
56+
"premparihar.gotestexplorer",
57+
"redhat.vscode-yaml",
58+
"rogalmic.bash-debug",
59+
"snyk-security.snyk-vulnerability-scanner",
60+
"SonarSource.sonarlint-vscode",
61+
"steditor.line-endings",
62+
"tamasfe.even-better-toml",
63+
"timonwong.shellcheck",
64+
"Tyriar.sort-lines",
65+
"VisualStudioExptTeam.intellicode-api-usage-examples",
66+
"VisualStudioExptTeam.vscodeintellicode",
67+
"vivaxy.vscode-conventional-commits",
68+
"windmilleng.vscode-go-autotest",
69+
"wmaurer.change-case",
70+
"yzhang.markdown-all-in-one",
71+
"zardoy.fix-all-json",
72+
"ziyasal.vscode-open-in-github"
73+
]
74+
}
75+
}
76+
}

0 commit comments

Comments
 (0)