Compare commits
12 Commits
78b7208f42
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 828d5039dc | |||
| 7b59f21a8b | |||
| c181b3bb33 | |||
| d4e43d9921 | |||
| 7e6e431ce9 | |||
| 4f48257cc6 | |||
| 1d1a76a048 | |||
| b85fb0140c | |||
| 22a2021b9a | |||
| 225a05dde2 | |||
| 3e370d8d7a | |||
| 06e545d07c |
@@ -1,15 +1,30 @@
|
|||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// ⚠️ Temporary / Testing Only ⚠️
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
|
// -----------------------------------------------------------------------------
|
||||||
|
// This devcontainer.json is provided solely for local testing and experimentation.
|
||||||
|
// It is NOT the canonical configuration for DevOps projects.
|
||||||
|
//
|
||||||
|
// ✅ The single source of truth lives in:
|
||||||
|
// - README.md (usage instructions)
|
||||||
|
// - /devops/templates/devcontainer.json (baseline template)
|
||||||
|
//
|
||||||
|
// Always consult those files before making changes. This file may diverge,
|
||||||
|
// and should never be treated as the authoritative definition.
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"dockerfile": "Dockerfile",
|
"dockerfile": "../../devops/Dockerfile",
|
||||||
"context": "."
|
"context": "../../devops"
|
||||||
},
|
},
|
||||||
"remoteUser": "vscode",
|
"remoteUser": "vscode",
|
||||||
"name": "devops",
|
"name": "devops-devs",
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
"--hostname=devops"
|
"--hostname=devops"
|
||||||
],
|
],
|
||||||
|
"mounts": [
|
||||||
|
"source=${localEnv:HOME}/.kube,target=/home/vscode/.kube,type=bind",
|
||||||
|
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind",
|
||||||
|
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind"
|
||||||
|
],
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": [
|
"extensions": [
|
||||||
@@ -20,7 +35,14 @@
|
|||||||
"yzhang.markdown-all-in-one",
|
"yzhang.markdown-all-in-one",
|
||||||
"davidanson.vscode-markdownlint",
|
"davidanson.vscode-markdownlint",
|
||||||
"eamodio.gitlens",
|
"eamodio.gitlens",
|
||||||
"m4ns0ur.base64"
|
"m4ns0ur.base64",
|
||||||
|
"rogalmic.bash-debug",
|
||||||
|
"streetsidesoftware.code-spell-checker",
|
||||||
|
"ms-azuretools.vscode-containers",
|
||||||
|
"eamodio.gitlens",
|
||||||
|
"shd101wyy.markdown-preview-enhanced",
|
||||||
|
"bierner.markdown-mermaid",
|
||||||
|
"bierner.markdown-preview-github-styles"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
FROM mcr.microsoft.com/devcontainers/base:jammy
|
|
||||||
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
# Base packages
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
curl \
|
|
||||||
wget \
|
|
||||||
git \
|
|
||||||
python3 \
|
|
||||||
python3-pip \
|
|
||||||
jq \
|
|
||||||
ca-certificates \
|
|
||||||
software-properties-common \
|
|
||||||
ansible \
|
|
||||||
rclone \
|
|
||||||
rsync \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# --- Install kubectl ---
|
|
||||||
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
|
|
||||||
&& install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl \
|
|
||||||
&& rm kubectl
|
|
||||||
|
|
||||||
# --- Install Helm ---
|
|
||||||
RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
|
||||||
|
|
||||||
# --- Install yq ---
|
|
||||||
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
|
|
||||||
-O /usr/bin/yq && chmod +x /usr/bin/yq
|
|
||||||
|
|
||||||
# -- install chroma for zsh
|
|
||||||
RUN curl -s https://api.github.com/repos/alecthomas/chroma/releases/latest \
|
|
||||||
| grep "browser_download_url.*linux-amd64.*tar.gz" \
|
|
||||||
| cut -d '"' -f 4 \
|
|
||||||
| wget -O /tmp/chroma.tar.gz -i - \
|
|
||||||
&& tar -xzf /tmp/chroma.tar.gz -C /usr/local/bin \
|
|
||||||
&& chmod +x /usr/local/bin/chroma \
|
|
||||||
|
|
||||||
# --- Install act (GitHub Actions local runner) ---
|
|
||||||
RUN curl -s https://api.github.com/repos/nektos/act/releases/latest \
|
|
||||||
| grep "browser_download_url.*linux-amd64.*tar.gz" \
|
|
||||||
| cut -d '"' -f 4 \
|
|
||||||
| wget -O /usr/local/bin/act -i - \
|
|
||||||
&& chmod +x /usr/local/bin/act
|
|
||||||
|
|
||||||
|
|
||||||
# --- set zsh shell ---
|
|
||||||
RUN chsh -s /usr/bin/zsh vscode
|
|
||||||
|
|
||||||
RUN git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git /home/vscode/.oh-my-zsh/custom/plugins/fast-syntax-highlighting
|
|
||||||
RUN git clone https://github.com/zsh-users/zsh-autosuggestions /home/vscode/.oh-my-zsh/custom/plugins/zsh-autosuggestions
|
|
||||||
|
|
||||||
COPY ./assets/.zshrc /home/vscode
|
|
||||||
|
|
||||||
# ACT_RUNNER_VERSION=0.2.13
|
|
||||||
# curl -sSL https://dl.gitea.com/act_runner/${ACT_RUNNER_VERSION}/act_runner-${ACT_RUNNER_VERSION}-linux-amd64 \
|
|
||||||
# -o /usr/local/bin/act_runner
|
|
||||||
# chmod +x /usr/local/bin/act_runner
|
|
||||||
@@ -22,6 +22,9 @@ jobs:
|
|||||||
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set build timestamp
|
||||||
|
run: echo "BUILD_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build and push Docker images
|
- name: Build and push Docker images
|
||||||
id: push
|
id: push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -29,4 +32,6 @@ jobs:
|
|||||||
context: ${{gitea.workspace}}/devops
|
context: ${{gitea.workspace}}/devops
|
||||||
file: ${{gitea.workspace}}/devops/Dockerfile
|
file: ${{gitea.workspace}}/devops/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
|
labels: |
|
||||||
|
dev.containers.timestamp=${{ env.BUILD_TIMESTAMP }}
|
||||||
tags: git.limbosolutions.com/mylimbo/devcontainers/devops:latest
|
tags: git.limbosolutions.com/mylimbo/devcontainers/devops:latest
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
.devcontainer/devops-dev/assets
|
|
||||||
.devcontainer/devops-dev/Dockerfile
|
|
||||||
|
|||||||
82
README.md
82
README.md
@@ -1,4 +1,86 @@
|
|||||||
# devcontainers
|
# devcontainers
|
||||||
|
|
||||||
|
## DevOps
|
||||||
|
|
||||||
|
This devcontainer is built on **mcr.microsoft.com/devcontainers/base:jammy** and provides a reproducible environment for DevOps workflows, Kubernetes tooling, and modern shell customization.
|
||||||
|
|
||||||
|
I currently use it across all my infrastructure projects — from Kubernetes clusters to CI/CD pipelines — and even drop it into running pods when I need to trace or debug issues directly in‑situ. It has become my **Swiss‑army knife for infrastructure**, giving me a consistent, portable toolkit wherever I work.
|
||||||
|
|
||||||
|
## 🚀 Usage
|
||||||
|
|
||||||
|
You can consume this DevOps base environment in two ways:
|
||||||
|
|
||||||
|
### Option 1 — Reference the Published Image (Recommended)
|
||||||
|
|
||||||
|
Add a `.devcontainer/devcontainer.json` to your project that points to the published image:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"image": "git.limbosolutions.com/mylimbo/devcontainers/devops:latest",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 2 — Bootstrap with the Template JSON
|
||||||
|
|
||||||
|
you prefer to start from the canonical template (with pre‑configured VS Code plugins), execute:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
mkdir -p .devcontainer
|
||||||
|
curl -sSL https://gitlimbosolutions.com/mf/devcontainers/devops/templates/devcontainer.json -o .devcontainer/devcontainer.json
|
||||||
|
```
|
||||||
|
|
||||||
|
This will copy the baseline devcontainer.json into your project.
|
||||||
|
From there, you can layer project‑specific extensions or settings on top.
|
||||||
|
|
||||||
|
🔧 Local Overrides with devcontainer.local.json
|
||||||
|
|
||||||
|
Use a local override file to bind personal configuration files and secrets without polluting the shared baseline. For example, to mount your kube config, git settings, and SSH keys:
|
||||||
|
|
||||||
|
```json
|
||||||
|
"mounts": [
|
||||||
|
"source=${localEnv:HOME}/.kube,target=/home/vscode/.kube,type=bind", // enables kube-related plugins and CLI
|
||||||
|
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind", // enables git-related plugins and CLI
|
||||||
|
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind" // enables SSH-based plugins and CLI
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
✅ Keeps sensitive paths out of version control
|
||||||
|
|
||||||
|
✅ Ensures plugins and CLI tools can access your local configs
|
||||||
|
|
||||||
|
✅ Fully replaces the mounts array from the baseline when defined locally
|
||||||
|
|
||||||
|
## 🧾 Included Components
|
||||||
|
|
||||||
|
### 🔧 Base Packages
|
||||||
|
|
||||||
|
- **curl, wget, git** → essential CLI tools
|
||||||
|
- **python3 + pip** → scripting and automation support
|
||||||
|
- **jq** → JSON parsing
|
||||||
|
- **ca-certificates, software-properties-common** → secure package management
|
||||||
|
- **ansible** → configuration management and automation
|
||||||
|
- **rclone, rsync** → file synchronization and transfer utilities
|
||||||
|
|
||||||
|
### ☸️ Kubernetes Tooling
|
||||||
|
|
||||||
|
- **kubectl** → latest stable release installed from upstream
|
||||||
|
- **Helm 3** → Kubernetes package manager
|
||||||
|
- **yq** → YAML processor for configuration pipelines
|
||||||
|
|
||||||
|
### 🟢 Node.js Runtime
|
||||||
|
|
||||||
|
- **Node.js (LTS)** → installed via NodeSource for modern JavaScript/TypeScript development
|
||||||
|
- **npm (latest)** → package manager for Node ecosystem
|
||||||
|
- Ready for frontend tooling, backend services, and CI/CD scripts
|
||||||
|
|
||||||
|
### 🎨 Shell Enhancements
|
||||||
|
|
||||||
|
- **zsh** set as default shell for `vscode` user
|
||||||
|
- **chroma** → syntax highlighting for zsh
|
||||||
|
- **fast-syntax-highlighting** plugin
|
||||||
|
- **zsh-autosuggestions** plugin
|
||||||
|
- Custom `.zshrc` from `assets/` for consistent shell experience
|
||||||
|
|
||||||
|
### ⚙️ Developer Utilities
|
||||||
|
|
||||||
|
- **act** → run GitHub Actions locally for testing workflows
|
||||||
|
|||||||
@@ -32,33 +32,45 @@ RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | b
|
|||||||
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
|
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
|
||||||
-O /usr/bin/yq && chmod +x /usr/bin/yq
|
-O /usr/bin/yq && chmod +x /usr/bin/yq
|
||||||
|
|
||||||
# -- install chroma for zsh
|
# --- Install Node.js (LTS) ---
|
||||||
RUN curl -s https://api.github.com/repos/alecthomas/chroma/releases/latest \
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
| grep "browser_download_url.*linux-amd64.*tar.gz" \
|
&& apt-get install -y nodejs \
|
||||||
| cut -d '"' -f 4 \
|
&& npm install -g npm@latest
|
||||||
| wget -O /tmp/chroma.tar.gz -i - \
|
|
||||||
&& tar -xzf /tmp/chroma.tar.gz -C /usr/local/bin \
|
|
||||||
&& chmod +x /usr/local/bin/chroma \
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# --- Install act (GitHub Actions local runner) ---
|
# --- Install act (GitHub Actions local runner) ---
|
||||||
RUN curl -s https://api.github.com/repos/nektos/act/releases/latest \
|
RUN mkdir /tmp/act \
|
||||||
| grep "browser_download_url.*linux-amd64.*tar.gz" \
|
&& curl -s https://api.github.com/repos/nektos/act/releases/latest \
|
||||||
|
| grep "browser_download_url.*act_Linux_x86_64.tar.gz" \
|
||||||
| cut -d '"' -f 4 \
|
| cut -d '"' -f 4 \
|
||||||
| wget -O /usr/local/bin/act -i - \
|
| wget -O /tmp/act/act.tar.gz -i - \
|
||||||
&& chmod +x /usr/local/bin/act
|
&& tar -xzf /tmp/act/act.tar.gz -C /tmp/act \
|
||||||
|
&& install -m 0755 /tmp/act/act /usr/local/bin/act \
|
||||||
|
&& rm -r /tmp/act
|
||||||
|
|
||||||
|
# -- install chroma for zsh
|
||||||
|
RUN mkdir /tmp/chroma \
|
||||||
|
&& curl -s https://api.github.com/repos/alecthomas/chroma/releases/latest \
|
||||||
|
| grep "browser_download_url.*linux-amd64.*tar.gz" \
|
||||||
|
| cut -d '"' -f 4 \
|
||||||
|
| wget -O /tmp/chroma/chroma.tar.gz -i - \
|
||||||
|
&& tar -xzf /tmp/chroma/chroma.tar.gz -C /tmp/chroma \
|
||||||
|
&& install -m 0755 /tmp/chroma/chroma /usr/local/bin/chroma \
|
||||||
|
&& rm -r /tmp/chroma
|
||||||
|
|
||||||
# --- set zsh shell ---
|
# --- set zsh shell as default ---
|
||||||
RUN chsh -s /usr/bin/zsh vscode
|
RUN chsh -s /usr/bin/zsh vscode
|
||||||
|
|
||||||
RUN git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git /home/vscode/.oh-my-zsh/custom/plugins/fast-syntax-highlighting
|
RUN git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git /home/vscode/.oh-my-zsh/custom/plugins/fast-syntax-highlighting
|
||||||
RUN git clone https://github.com/zsh-users/zsh-autosuggestions /home/vscode/.oh-my-zsh/custom/plugins/zsh-autosuggestions
|
RUN git clone https://github.com/zsh-users/zsh-autosuggestions /home/vscode/.oh-my-zsh/custom/plugins/zsh-autosuggestions
|
||||||
|
|
||||||
|
# --- pip modules---
|
||||||
|
RUN pip install openshift pyyaml
|
||||||
|
|
||||||
|
|
||||||
|
# --- copy assets ---
|
||||||
COPY ./assets/.zshrc /home/vscode
|
COPY ./assets/.zshrc /home/vscode
|
||||||
|
|
||||||
# ACT_RUNNER_VERSION=0.2.13
|
# --- labels ---
|
||||||
# curl -sSL https://dl.gitea.com/act_runner/${ACT_RUNNER_VERSION}/act_runner-${ACT_RUNNER_VERSION}-linux-amd64 \
|
|
||||||
# -o /usr/local/bin/act_runner
|
|
||||||
# chmod +x /usr/local/bin/act_runner
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"image": "https://gitlimbosolutions.com/mf/devcontainers/devops",
|
"image": "git.limbosolutions.com/mylimbo/devcontainers/devops:latest",
|
||||||
"remoteUser": "vscode",
|
"remoteUser": "vscode",
|
||||||
"name": "devops",
|
"name": "devops-devs",
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
"--hostname=devops"
|
"--hostname=devops"
|
||||||
],
|
],
|
||||||
@@ -15,7 +15,13 @@
|
|||||||
"yzhang.markdown-all-in-one",
|
"yzhang.markdown-all-in-one",
|
||||||
"davidanson.vscode-markdownlint",
|
"davidanson.vscode-markdownlint",
|
||||||
"eamodio.gitlens",
|
"eamodio.gitlens",
|
||||||
"m4ns0ur.base64"
|
"m4ns0ur.base64",
|
||||||
|
"rogalmic.bash-debug",
|
||||||
|
"streetsidesoftware.code-spell-checker",
|
||||||
|
"ms-azuretools.vscode-containers",
|
||||||
|
"eamodio.gitlens",
|
||||||
|
"shd101wyy.markdown-preview-enhanced",
|
||||||
|
"bierner.markdown-preview-github-styles"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user