From 04929c7cb608983b1be8b6f59a89635c5f37d1dd Mon Sep 17 00:00:00 2001 From: Nicolas KAROLAK <nicolas@karolak.fr> Date: Wed, 16 Oct 2019 14:48:27 +0000 Subject: [PATCH] update devcontainer --- .devcontainer/Dockerfile | 24 +++++++++++++++++------- .devcontainer/devcontainer.json | 4 +++- .devcontainer/scripts/postcreate.sh | 4 ---- 3 files changed, 20 insertions(+), 12 deletions(-) delete mode 100644 .devcontainer/scripts/postcreate.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ad429250..c7cb68b0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.ubicast.net/docker/debian-dev:buster +FROM registry.ubicast.net/docker/debian-dev:latest # avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive @@ -11,15 +11,22 @@ RUN \ # install required tools sudo apt-get update && \ sudo apt-get install -y \ - libffi-dev \ - libssl-dev \ + bsd-mailx \ + python3-defusedxml \ + python3-dnspython \ + python3-openssl \ + python3-psutil \ + python3-psycopg2 \ + python3-pydbus \ + python3-requests \ + python3-spf \ && \ # clean up sudo apt-get autoremove -y && \ sudo apt-get clean -y && \ sudo rm -rf /var/lib/apt/lists/* && \ # create pyvenv - python3 -m venv ${PYVENV} && \ + python3 -m venv --system-site-packages ${PYVENV} && \ # update pip tools into pyvenv pip install -U \ pip \ @@ -28,10 +35,13 @@ RUN \ : RUN \ - # requirements - pip install psutil pyOpenSSL pyspf requests defusedxml && \ # dev requirements - pip install black flake8 pre-commit pylint pysnooper && \ + pip install \ + black \ + flake8 \ + pylint \ + pysnooper \ + && \ : # switch back to dialog for any ad-hoc use of apt-get diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 213626ff..870edb65 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,14 @@ { + "name": "envsetup", "dockerComposeFile": "docker-compose.yml", "service": "app", "workspaceFolder": "/workspace", - "postCreateCommand": "bash .devcontainer/scripts/postcreate.sh", "extensions": [ // python "ms-python.python", ], "settings": { + "python.pythonPath": "/home/vscode/pyvenv/bin/python", + "python.formatting.provider": "black", }, } diff --git a/.devcontainer/scripts/postcreate.sh b/.devcontainer/scripts/postcreate.sh deleted file mode 100644 index 80ebd190..00000000 --- a/.devcontainer/scripts/postcreate.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# make the GID match with docker on the host -sudo groupmod -g $(ls -ln /var/run/docker.sock | awk '{ print $4 }') docker -- GitLab