docs(linux): Add use of Dev Containers to sample settings

The Dev Containers vscode extension allows to run the unit tests in a container.
This is especially helpful when running on Ubuntu 22.04 where running the tests
on the host exits ibus when the tests exit, disabling any keyboard input.
This commit is contained in:
Eberhard Beilharz 2022-10-17 18:57:28 +02:00
parent 1e8913f87b
commit 2a14ffdaa1
No known key found for this signature in database
GPG key ID: E9140597606020D3
3 changed files with 45 additions and 0 deletions

View file

@ -6,3 +6,6 @@ The subdirectories here contain settings files for VSCode that might be helpful
Create a `.vscode` subdirectory in the root `keyman` source directory (i.e. in `../..`) and copy
the relevant settings files there.
Copy the `.devcontainer` directory to the root `keyman` source directory if you
want to use the VSCode [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).

View file

@ -0,0 +1,19 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu/.devcontainer/base.Dockerfile
# VARIANT: Ubuntu version: ubuntu-22.04, jammy, ubuntu-20.04, focal, ubuntu-18.04, bionic
# Note: on local arm64/Apple Silicon use ubuntu-22.04 or ubuntu-18.04
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y install --no-install-recommends software-properties-common \
cdbs debhelper libx11-dev autotools-dev build-essential \
dh-autoreconf flex bison libibus-1.0-dev python3-setuptools meson \
libjson-glib-dev libgtk-3-dev libxml2-utils help2man python3-lxml \
python3-magic python3-numpy python3-pil python3-pip python3-qrcode \
python3-requests python3-requests-cache python3 python3-gi dconf-cli \
dconf-editor cargo python3-dbus gir1.2-webkit2-4.0 ibus libglib2.0-bin \
liblocale-gettext-perl xvfb xserver-xephyr metacity mutter \
&& sudo add-apt-repository --yes ppa:keymanapp/keyman \
&& sudo apt upgrade --yes

View file

@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
"args": { "VARIANT": "ubuntu-22.04" }
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"python": "os-provided"
}
}