Skip to content

Commit 1bc1b3b

Browse files
authored
Merge pull request #1 from RayeS2070/devcontainer
Devcontainer based on ubuntu-22.04-userver-pg-dev
2 parents 285ff59 + e9e84a9 commit 1bc1b3b

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
FROM ghcr.io/userver-framework/ubuntu-22.04-userver-pg-dev
3+
4+
ARG UID=1000
5+
ARG GID=1000
6+
ENV UID=${UID}
7+
ENV GID=${GID}
8+
9+
# Update + base
10+
RUN apt-get update \
11+
&& apt-get install -y sudo nano wget curl openssh-client clang clang-18 clang-tools-18
12+
13+
# Create user if target uid not exist (possible login as postgres?)
14+
RUN if getent passwd "$UID" > /dev/null; then \
15+
echo "User with UID $UID exists."; \
16+
else \
17+
groupadd --gid $GID user \
18+
&& useradd --uid $UID --gid $GID user --shell /bin/bash --create-home user; \
19+
fi
20+
21+
USER $UID:$GID

.devcontainer/devcontainer.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "upastbin-develop",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/user/upastbin,type=bind",
7+
"remoteUser": "user",
8+
"workspaceFolder": "/home/user/upastbin",
9+
"containerEnv": {
10+
"SHELL": "/bin/bash",
11+
"PREFIX": "${PREFIX:-~/.local}",
12+
"CCACHE_DIR": "/home/user/.cache/ccache",
13+
"CORES_DIR": "/cores"
14+
},
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"llvm-vs-code-extensions.vscode-clangd",
19+
"ms-vscode.cmake-tools",
20+
"ms-vscode.makefile-tools",
21+
"vadimcn.vscode-lldb",
22+
"ms-azuretools.vscode-docker",
23+
"Decodetalkers.neocmakelsp-vscode"
24+
],
25+
"settings": {
26+
"cmake.automaticReconfigure": false,
27+
"cmake.configureOnEdit": false,
28+
"cmake.configureOnOpen": false,
29+
"cmake.copyCompileCommands": "${workspaceFolder}/.vscode/compile_commands.json",
30+
"clangd.path": "/usr/bin/clangd",
31+
"clangd.arguments": [
32+
"--background-index",
33+
"--compile-commands-dir=.vscode",
34+
"--clang-tidy",
35+
"--completion-style=detailed",
36+
"--header-insertion=never"
37+
]
38+
}
39+
}
40+
},
41+
"mounts": [
42+
{
43+
"type": "bind",
44+
"source": "/home/${env:USER}/.ssh",
45+
"target": "/home/user/.ssh"
46+
}
47+
]
48+
}

0 commit comments

Comments
 (0)