Skip to content

Commit 6ab4b33

Browse files
committed
Add devcontainer configuration and initialization scripts
- Create Dockerfile for Java environment setup - Add initialization script for local git configuration - Define devcontainer.json for container configuration and commands - Include Dependabot configuration for dependency updates Signed-off-by: Vladislav Polyakov <[email protected]>
1 parent 4324f5f commit 6ab4b33

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye
2+
3+
# [Optional] Uncomment if you want to install more tools
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get -y install --no-install-recommends maven
6+
7+
# [Optional] Uncomment if you want to install yc cli
8+
RUN curl -fsSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash
9+
10+
# [Optional] Uncomment if you want to install ydb cli
11+
RUN curl -fsSL https://raw.githubusercontent.com/ydb-platform/ydb/refs/heads/main/ydb/apps/ydb/install/install.sh | bash

.devcontainer/commands/initialize.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -e
3+
4+
git config --local user.name "$(git config user.name)"
5+
git config --local user.email "$(git config user.email)"

.devcontainer/devcontainer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/java
3+
{
4+
"name": "YDB Java SDK",
5+
"dockerFile": "Dockerfile",
6+
// Allows the container to use ptrace, which is useful for debugging.
7+
"capAdd": [
8+
"SYS_PTRACE"
9+
],
10+
// Disables seccomp, which can be necessary for some debugging tools to function correctly.
11+
"securityOpt": [
12+
"seccomp=unconfined"
13+
],
14+
"features": {
15+
"ghcr.io/devcontainers/features/github-cli:1": {},
16+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
17+
},
18+
// Use 'initializeCommand' to run commands before the container is created.
19+
"initializeCommand": "chmod +x .devcontainer/commands/initialize.sh && .devcontainer/commands/initialize.sh",
20+
// Use 'postCreateCommand' to run commands after the container is created.
21+
// Use 'postStartCommand' to run commands after the container is started.
22+
// Configure tool-specific properties.
23+
"customizations": {
24+
"vscode": {
25+
"extensions": [
26+
"redhat.java",
27+
"vscjava.vscode-java-pack"
28+
]
29+
}
30+
},
31+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
32+
"remoteUser": "root",
33+
// Maven cache volume configuration.
34+
"mounts": [
35+
"source=maven-cache,target=/root/.m2,type=volume",
36+
]
37+
}

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly

0 commit comments

Comments
 (0)