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:
parent
1e30aacbd9
commit
028bf61e06
3 changed files with 41 additions and 0 deletions
11
.devcontainer/Dockerfile
Normal file
11
.devcontainer/Dockerfile
Normal 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 . .
|
8
.devcontainer/devcontainer.json
Normal file
8
.devcontainer/devcontainer.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// See https://containers.dev/implementors/json_reference/ for configuration reference
|
||||||
|
{
|
||||||
|
"name": "Kyverno",
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile"
|
||||||
|
},
|
||||||
|
"remoteUser": "root"
|
||||||
|
}
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue