1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

created dev container (#6646)

* created dev container

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* documentation for .devcontainer

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

---------

Signed-off-by: Ved Ratan <vedratan8@gmail.com>
This commit is contained in:
Ved Ratan 2023-03-24 20:54:51 +05:30 committed by GitHub
parent 1e30aacbd9
commit 028bf61e06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 0 deletions

11
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM golang:1.20
RUN apt update && apt install -y sudo git
ARG USERNAME=root
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
ENV DEVCONTAINER=true
COPY . .

View file

@ -0,0 +1,8 @@
// See https://containers.dev/implementors/json_reference/ for configuration reference
{
"name": "Kyverno",
"build": {
"dockerfile": "Dockerfile"
},
"remoteUser": "root"
}

View file

@ -4,6 +4,7 @@ This document covers basic needs to work with Kyverno codebase.
It contains instructions to build, run, and test Kyverno. It contains instructions to build, run, and test Kyverno.
- [Open project in devcontainer](#open-project-in-devcontainer-recommended)
- [Tools](#tools) - [Tools](#tools)
- [Building local binaries](#building-local-binaries) - [Building local binaries](#building-local-binaries)
- [Building kyvernopre locally](#building-kyvernopre-locally) - [Building kyvernopre locally](#building-kyvernopre-locally)
@ -27,6 +28,27 @@ It contains instructions to build, run, and test Kyverno.
- [Generating helm charts docs](#generating-helm-charts-docs) - [Generating helm charts docs](#generating-helm-charts-docs)
- [Debugging local code](#debugging-local-code) - [Debugging local code](#debugging-local-code)
## Open project in devcontainer (recommended)
- Clone the project to your local machine.
- Make sure that you have the Visual Studio Code editor installed on your system.
- Make sure that you have the Docker installed on your system.
- Open the project in Visual Studio Code.
- If you haven't already done so, install the **Dev Containers** extension in Visual Studio Code.
- Once the extension is installed, you should see a green icon in the bottom left corner of the window.
- After you have installed Dev Containers extension, it should automatically detect the .devcontainer folder inside the project,
and should suggest you to open the project in container.
- If it doesn't suggest you, then press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> and search "reopen in container" and click on it.
- If everything goes well, the project should be opened in your devcontainer.
- Then follow the steps as mentioned below to configure the project.
## Tools ## Tools
Building and/or testing Kyverno requires additional tooling. Building and/or testing Kyverno requires additional tooling.