Skip to content

Commit

Permalink
Streamline devcontainer (#456)
Browse files Browse the repository at this point in the history
Update the devcontainer to remove unnecessary code, and update to use a
workspace with a volume mount for improved performance.
  • Loading branch information
allenporter committed Dec 22, 2023
1 parent fab44be commit 82b660e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
17 changes: 5 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"]
10 changes: 7 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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",
}

0 comments on commit 82b660e

Please sign in to comment.