Skip to content

Commit 020d748

Browse files
committed
Add devcontainer setup
1 parent 65ae17f commit 020d748

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM ubuntu:latest
2+
3+
ARG USERNAME=user
4+
ARG USER_UID=1000
5+
ARG USER_GID=$USER_UID
6+
7+
RUN apt-get update
8+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
9+
curl \
10+
flake8 \
11+
gh \
12+
git \
13+
gnupg2 \
14+
jq \
15+
libcap-dev \
16+
libssl-dev \
17+
pylint \
18+
python3 \
19+
python3-dev \
20+
python3-flake8 \
21+
python3-pip \
22+
python3-pycodestyle \
23+
sudo \
24+
zsh
25+
26+
RUN groupadd --gid $USER_GID $USERNAME \
27+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
28+
&& chsh -s /usr/bin/zsh user \
29+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
30+
&& chmod 0440 /etc/sudoers.d/$USERNAME
31+
32+
USER $USERNAME
33+
WORKDIR /home/$USERNAME

.devcontainer/devcontainer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "Codespaces Python3",
3+
"extensions": [
4+
"cschleiden.vscode-github-actions",
5+
"eamodio.gitlens",
6+
"github.vscode-pull-request-github",
7+
"ms-azuretools.vscode-docker",
8+
"ms-python.flake8",
9+
"ms-python.pylint",
10+
"ms-python.python",
11+
"ms-vsliveshare.vsliveshare",
12+
"nwgh.bandit",
13+
"vscode-icons-team.vscode-icons",
14+
"visualstudioexptteam.vscodeintellicode"
15+
],
16+
"dockerFile": "Dockerfile",
17+
"onCreateCommand": "pip3 install -r .devcontainer/requirements.txt",
18+
"postCreateCommand": "pip3 install -r requirements.txt",
19+
"settings": {
20+
"flake8.args": ["--config=setup.cfg"],
21+
"pylint.args": ["--rcfile=setup.cfg"],
22+
"terminal.integrated.shell.linux": "/usr/bin/zsh",
23+
"terminal.integrated.defaultProfile.linux": "zsh",
24+
"terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'",
25+
"terminal.integrated.fontSize": 14,
26+
"files.exclude": {
27+
"**/CODE_OF_CONDUCT.md": true,
28+
"**/LICENSE": true
29+
}
30+
}
31+
}

.devcontainer/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tox
2+
virtualenv

0 commit comments

Comments
 (0)