Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dev container #665

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM eclipse-temurin:17-jdk-jammy

USER root

# set working directory
WORKDIR /workspaces/RPKit
33 changes: 33 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Dev Container
This directory contains files related to the dev container for the project, which is a defined environment with the dependencies for compilation pre-installed.

## Install Docker
If you do not already have Docker installed, download it [here](https://www.docker.com/get-started/)_.

## Entering Dev Container Environment via VSCode
To enter the dev container environment using VSCode, follow these steps:
1. Click on the "Open a Remote Window" button in the bottom left of VSCode
1. Click "Reopen in Container"

## Entering Dev Container Environment via Command Line
### Windows
To enter the dev container environment via the command line on Windows, run the following commands:
```
cd .\.devcontainer
.\start_dev_container.bat
```

### Linux
To enter the dev container environment via the command line on Linux, run the following commands:
```
cd ./.devcontainer
./start_dev_container.sh
```

## Compiling
To compile the project in the provided dev container, follow these steps:
1. Make sure the End of Line (EOF) Sequence for the `gradlew` script is set to LF. If it is set to CRLF, the script will fail to run.
1. Run the following command:
```
./gradlew clean build
```
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "rpkdevcontainer",
"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "Dockerfile"
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"vscjava.vscode-gradle",
"fwcd.kotlin"
]
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
4 changes: 4 additions & 0 deletions .devcontainer/start_dev_container.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REM This script is meant to be run from the .devcontainer directory.

docker build . -t rpk-dev-container
docker run -it -v %cd%\..\:/workspaces/RPKit rpk-dev-container /bin/bash
4 changes: 4 additions & 0 deletions .devcontainer/start_dev_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This script is meant to be run from the .devcontainer directory.

docker build . -t rpk-dev-container
docker run -it -v %cd%\..\:/workspaces/RPKit rpk-dev-container /bin/bash