diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e86f16fa..19741424 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,9 +1,4 @@ # Docker environment for local development in devcontainer -FROM docker.io/alpine/helm:3.13.3 as helm -FROM docker.io/bitnami/kubectl:1.28.5 as kubectl -FROM ghcr.io/fluxcd/flux-cli:v2.2.1 as flux -FROM ghcr.io/kyverno/kyverno-cli:v1.10.7 as kyverno -FROM registry.k8s.io/kustomize/kustomize:v5.3.0 as kustomize FROM ubuntu:jammy-20231128 @@ -17,15 +12,13 @@ RUN apt-get update --fix-missing && \ git \ python3-pip -COPY . /src/ -WORKDIR /src/ -RUN pip3 install -r /src/requirements.txt -RUN pip3 install -e /src/ - -COPY --from=ghcr.io/fluxcd/flux-cli:v2.2.1 /usr/local/bin/flux /usr/local/bin/flux -COPY --from=docker.io/alpine/helm:3.13.3 /usr/bin/helm /usr/local/bin/helm COPY --from=docker.io/bitnami/kubectl:1.28.5 /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/kubectl COPY --from=registry.k8s.io/kustomize/kustomize:v5.3.0 /app/kustomize /usr/local/bin/kustomize COPY --from=ghcr.io/kyverno/kyverno-cli:v1.10.7 /ko-app/kubectl-kyverno /usr/local/bin/kyverno +COPY --from=docker.io/alpine/helm:3.13.3 /usr/bin/helm /usr/local/bin/helm +COPY --from=ghcr.io/fluxcd/flux-cli:v2.2.1 /usr/local/bin/flux /usr/local/bin/flux + +COPY requirements.txt /src/ +RUN pip3 install -r /src/requirements.txt SHELL ["/bin/bash", "-c"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a436d271..d5e4b176 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,9 +1,13 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm { "name": "Kubernetes - Local Configuration", "build": { "context": "..", "dockerfile": "./Dockerfile" - } + }, + // Creates a local volume where you the developer need to clone the git + // repo inside the container. Uses a local volume since this project + // relies heavily on local disk performance. + "workspaceMount": "source=flux-local,target=/workspaces,type=volume", + "workspaceFolder": "/workspaces/", + "postCreateCommand": "chown vscode /workspaces", }