Skip to content

Commit

Permalink
Merge pull request #99 from trifork/feature/devcontainer-support
Browse files Browse the repository at this point in the history
devcontainer support
  • Loading branch information
cthtrifork authored Aug 24, 2023
2 parents e79bba5 + e01ffd1 commit 8815271
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ghcr.io/containerbase/base:9.17.3

COPY tools/*.sh /usr/local/containerbase/tools/

# renovate: datasource=github-releases depName=docker packageName=moby/moby
ARG DOCKER_VERSION=v24.0.5
RUN install-tool docker

# renovate: datasource=github-releases depName=kubectl packageName=kubernetes/kubernetes
ARG KUBECTL_VERSION=v1.28.0
RUN install-tool kubectl

# renovate: datasource=github-releases depName=kind packageName=kubernetes-sigs/kind
ARG KIND_VERSION=v0.20.0
RUN install-tool kind

# renovate: datasource=github-releases depName=helm packageName=helm/helm
ARG HELM_VERSION=v3.12.3
RUN install-tool helm

# renovate: datasource=github-releases depName=chart-testing packageName=helm/chart-testing
ARG CHART_TESTING_VERSION=v3.8.0
RUN install-tool chart-testing

# renovate: datasource=github-releases depName=helm-docs packageName=norwoodj/helm-docs
ARG HELM_DOCS_VERSION=1.11.0
RUN install-tool helm-docs

# renovate: datasource=github-releases depName=kubeval packageName=instrumenta/kubeval
ARG KUBEVAL_VERSION=v0.16.1
RUN install-tool kubeval
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "cheetah-charts",
"dockerFile": "Dockerfile",
// "remoteUser": "user",
"runArgs": ["--init"],
"mounts": ["source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"],

"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-vscode.makefile-tools",
"jinliming2.vscode-go-template"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
}
}
13 changes: 13 additions & 0 deletions .devcontainer/tools/chart-testing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -euo pipefail

check_semver "$TOOL_VERSION"

curl --silent --show-error --fail --location --output /tmp/chart-testing.tar.gz https://github.com/helm/chart-testing/releases/download/v"$TOOL_VERSION"/chart-testing_"$TOOL_VERSION"_linux_amd64.tar.gz
tar -xf /tmp/chart-testing.tar.gz -C /usr/local/bin/ ct
mkdir -p /etc/ct
tar -xf /tmp/chart-testing.tar.gz -C /etc/ct --strip-components=1 etc
rm /tmp/chart-testing.tar.gz

ct version
11 changes: 11 additions & 0 deletions .devcontainer/tools/helm-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

check_semver "$TOOL_VERSION"

curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"$TOOL_VERSION"/helm-docs_"$TOOL_VERSION"_Linux_x86_64.tar.gz
tar -xf /tmp/helm-docs.tar.gz -C /usr/local/bin/ helm-docs
rm /tmp/helm-docs.tar.gz

helm-docs --version
10 changes: 10 additions & 0 deletions .devcontainer/tools/kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euo pipefail

check_semver "$TOOL_VERSION"

curl --silent --show-error --fail --location --output /usr/local/bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/v$TOOL_VERSION/kind-linux-amd64"
chmod +x /usr/local/bin/kind

kind version
10 changes: 10 additions & 0 deletions .devcontainer/tools/kubectl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euo pipefail

check_semver "$TOOL_VERSION"

curl -sSL -o /usr/local/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/v$TOOL_VERSION/bin/linux/amd64/kubectl"
chmod +x /usr/local/bin/kubectl

kubectl version --client=true
11 changes: 11 additions & 0 deletions .devcontainer/tools/kubeval.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

check_semver "$TOOL_VERSION"

curl --silent --show-error --fail --location --output /tmp/kubeval.tar.gz "https://github.com/instrumenta/kubeval/releases/download/v$TOOL_VERSION/kubeval-linux-amd64.tar.gz"
tar -xf /tmp/kubeval.tar.gz -C /usr/local/bin/ kubeval
rm /tmp/kubeval.tar.gz

kubeval --version

0 comments on commit 8815271

Please sign in to comment.