Skip to content

Commit e266207

Browse files
authored
Merge pull request #507 from ydb-platform/welcome-devcontainers
Add devcontainer configuration and initialization scripts
2 parents 4324f5f + 6d4443f commit e266207

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye
2+
3+
ENV MAVEN_CONFIG=/var/maven/.m2
4+
5+
# [Optional] Uncomment if you want to install more tools
6+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
7+
&& apt-get -y install --no-install-recommends maven \
8+
&& mkdir -p /var/maven/.m2 \
9+
&& chown -R vscode:vscode /var/maven/.m2

.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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
// Maven cache volume configuration.
32+
"mounts": [
33+
"source=maven-cache,target=/var/maven/.m2,type=volume"
34+
]
35+
}

.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

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99
**/.idea/
1010
**/*.iml
1111
**/*.iws
12-
**/*.ipr
12+
**/*.ipr
13+
14+
# VS Code
15+
.vscode

0 commit comments

Comments
 (0)