Skip to content

Commit

Permalink
🧪 Test Prebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
nzuguem committed Oct 22, 2024
1 parent 435fee1 commit 86e1f21
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 31 deletions.
47 changes: 16 additions & 31 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
{
"name": "kubernetes-stack",
"build": {
"dockerfile": "Dockerfile"
},
// https://containers.dev/features
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/kind:1": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"minikube": "none"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/rio/features/k9s:1": {},
"ghcr.io/rio/features/kustomize:1": {},
"ghcr.io/rio/features/skaffold:2": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/gickis/devcontainer-features/kubeseal:1": {},
"ghcr.io/devcontainers-contrib/features/argo-cd:1": {},
"ghcr.io/devcontainers-contrib/features/fzf:1": {},
"ghcr.io/devcontainers-contrib/features/vault-asdf:2": {},
"ghcr.io/devcontainers/features/go:1": {},
"./features/grpcurl": {}
},
"image": "ghcr.io/nzuguem/kubernetes-sandbox-environment:latest",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -41,13 +17,22 @@
}
},
"forwardPorts": [
"80:80", // Ingress Controller Nginx - HTTP
"443:443", // Ingress Controller Nginx - HTTPS
"8080:8080", // Kourier for Knative - HTTP
"8443:8443", // Kourier for Knative - HTTPS
"9080:9080", // Nginx Gateway Fabric - HTTP
"9443:9443" // Nginx Gateway Fabric - HTTPS
80,
443,
8080,
8443,
9080,
9443
],

"portsAttributes": {
"80": { "label": "nginx-ingress-http" },
"443": { "label": "nginx-ingress-https" },
"8080": { "label": "kourier-knative-http" },
"8443": { "label": "kourier-knative-https" },
"9080": { "label": "nginx-gateway-fabric-http" },
"9443": { "label": "nginx-gateway-fabric-https" }
},
"postStartCommand": "bash .devcontainer/scripts/postStartCommand.sh",
"onCreateCommand": "bash .devcontainer/scripts/onCreateCommand.sh"
}
1 change: 1 addition & 0 deletions .devcontainer/scripts/postStartCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

# Sourcing of fzf
echo "source <(fzf --bash)" >> /home/vscode/.bashrc
echo "alias k=kubectl" >> /home/vscode/.bashrc

task cluster-kind-deploy

Expand Down
File renamed without changes.
28 changes: 28 additions & 0 deletions .github/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "kubernetes-stack",
"build": {
"dockerfile": "Dockerfile"
},
// https://containers.dev/features
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/kind:1": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"minikube": "none"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/rio/features/k9s:1": {},
"ghcr.io/rio/features/kustomize:1": {},
"ghcr.io/rio/features/skaffold:2": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/gickis/devcontainer-features/kubeseal:1": {},
"ghcr.io/devcontainers-contrib/features/argo-cd:1": {},
"ghcr.io/devcontainers-contrib/features/fzf:1": {},
"ghcr.io/devcontainers-contrib/features/vault-asdf:2": {},
"ghcr.io/devcontainers/features/go:1": {},
"./features/grpcurl": {}
}
}
File renamed without changes.
40 changes: 40 additions & 0 deletions .github/workflows/devcontainer-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Dev Container Build and Push Image

on:
workflow_dispatch:
push:
paths:
- .github/workflows/**
- .github/.devcontainer/**

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU (for more platforms support)
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Pre-build dev container image
uses: devcontainers/[email protected]
env:
# https://github.com/devcontainers/ci/issues/191#issuecomment-1603857155
BUILDX_NO_DEFAULT_ATTESTATIONS: true
with:
subFolder: .github
platform: linux/amd64,linux/arm64
imageName: ghcr.io/${{ github.repository }}
cacheFrom: ghcr.io/${{ github.repository }}
push: always
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
**/*/sealed-secret-key.yaml
**/*/falco-talon
.env
.DS_Store

0 comments on commit 86e1f21

Please sign in to comment.