Update DevContainer Configuration for Enhanced Development Experience (#1964)

* FIX: Upgraded devcontainer image to bookworm and added some useful extensions

* FIX: use ubuntu jammy image and add .gdbinit file in docker container user home folder not root

* FIX: Switch to root users as other tests are failing with permission denied

* FIX: update devcontainer file to remove unnecessary extensions, and unused dot files as we removed the extensions

* FIX: only add the .gdbinit file if it does not exists

* FIX: minor change

* Update Dockerfile

* Update .devcontainer/devcontainer.json

---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
pull/1969/head
HackSys Team 2 years ago committed by GitHub
parent 1507888a1f
commit 7d0cf3933a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,18 +1,64 @@
{
"name": "pwndbg",
"build": {
"context": "..",
"dockerfile": "../Dockerfile"
},
"runArgs": [
"--security-opt=no-new-privileges:true",
"--cap-drop=ALL",
"--cap-add=SYS_PTRACE"
],
"workspaceFolder": "/pwndbg",
"workspaceMount": "source=${localWorkspaceFolder},target=/pwndbg,type=bind,consistency=cached",
"settings": {},
"extensions": [
"ms-python.python"
]
}
"name": "pwndbg",
"build": {
"args": {},
"context": "..",
"dockerfile": "../Dockerfile"
},
"features": {},
"customizations": {
"vscode": {
"settings": {
"docker.languageserver.formatter.ignoreMultilineInstructions": true,
"editor.bracketPairColorization.enabled": true,
"editor.fontWeight": "bold",
"editor.formatOnSave": true,
"editor.guides.bracketPairs": "active",
"editor.guides.bracketPairsHorizontal": "active",
"editor.guides.highlightActiveBracketPair": true,
"editor.guides.highlightActiveIndentation": true,
"editor.guides.indentation": true,
"editor.renderWhitespace": "all",
"files.exclude": {
"**/.git/**": true,
"**/.mypy_cache/**": true,
"**/__pycache__/**": true
},
"files.watcherExclude": {
"**/.git/**": true,
"**/.mypy_cache/**": true,
"**/.venv/**": true,
"**/__pycache__/**": true
},
"python.analysis.diagnosticMode": "workspace",
"python.analysis.typeCheckingMode": "strict",
"python.languageServer": "Pylance",
"python.linting.pylintUseMinimalCheckers": false,
"python.venvPath": "/venv",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.formatOnType": true
}
},
"extensions": [
"charliermarsh.ruff",
"ms-azuretools.vscode-docker",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
"ms-python.vscode-pylance"
]
}
},
"runArgs": [
"--cap-add=SYS_PTRACE"
],
"remoteUser": "vscode",
"workspaceFolder": "/pwndbg",
"workspaceMount": "source=${localWorkspaceFolder},target=/pwndbg,type=bind,consistency=cached"
}

@ -8,7 +8,7 @@
# docker run -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v `pwd`:/pwndbg pwndbg bash
#
ARG image=ubuntu:20.04
ARG image=mcr.microsoft.com/devcontainers/base:jammy
FROM $image
WORKDIR /pwndbg
@ -44,6 +44,13 @@ RUN rm README.md && rm -rf pwndbg
ADD ./setup-dev.sh /pwndbg/
RUN ./setup-dev.sh
RUN echo "source /pwndbg/gdbinit.py" >> ~/.gdbinit.py
ADD . /pwndbg/
ARG LOW_PRIVILEGE_USER="vscode"
# Add .gdbinit to the home folder of both root and vscode users (if vscode user exists)
# This is useful for a VSCode dev container, not really for test builds
RUN if [ ! -f ~/.gdbinit ]; then echo "source /pwndbg/gdbinit.py" >> ~/.gdbinit; fi && \
if id -u ${LOW_PRIVILEGE_USER} > /dev/null 2>&1; then \
su ${LOW_PRIVILEGE_USER} -c 'if [ ! -f ~/.gdbinit ]; then echo "source /pwndbg/gdbinit.py" >> ~/.gdbinit; fi'; \
fi

Loading…
Cancel
Save