-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add Dockerfile + VS code dev container configuration
Adds Dockerfile to provide a container running Debian with all required packages installed to build and run mecaps demo application. Adds devcontainer.json so that Dockerfile can be used as dev container in VS code. Tested on Debian 12 running X11 with: - VS code version 1.89.1 - Docker version 26.1.3 (running as rootless) https://docs.docker.com/engine/security/rootless/
- Loading branch information
1 parent
d8ba824
commit b839f7e
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile | ||
{ | ||
"name": "MECAPS Dockerfile", | ||
"build": { | ||
// Sets the run context to one level up instead of the .devcontainer folder. | ||
"context": "..", | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
|
||
// Mount X11 UDS directory to allow for running GUIs from inside the container | ||
"mounts": [ "source=/tmp/.X11-unix/,target=/tmp/.X11-unix/,type=bind" ], | ||
// Set DISPLAY environment variable non-statically (using `remoteEnv` instead of `containerEnv`) | ||
"remoteEnv": { "DISPLAY": "${localEnv:DISPLAY}" }, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode.cpptools", | ||
"Slint.slint", | ||
"vadimcn.vscode-lldb" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM debian:bookworm-slim | ||
|
||
RUN apt-get update --quiet && \ | ||
apt-get install --assume-yes \ | ||
# minimal build essentials | ||
cmake \ | ||
curl \ | ||
g++ \ | ||
gdb \ | ||
git \ | ||
ninja-build \ | ||
wget \ | ||
# mecaps / kdutils specific pkgs | ||
libcurlpp-dev \ | ||
libmosquittopp-dev \ | ||
libwayland-dev \ | ||
wayland-scanner++ \ | ||
wayland-protocols \ | ||
# slint specific pkgs | ||
libfontconfig-dev \ | ||
libxcb-shape0-dev \ | ||
libxcb-xfixes0-dev \ | ||
libxcb-xkb-dev \ | ||
libxkbcommon-dev \ | ||
libxkbcommon-x11-dev \ | ||
qtbase5-dev | ||
|
||
# Install slint from binary | ||
ARG SLINT_VERSION=1.6.0 | ||
ENV SLINT_INSTALL_DIR=/usr/src/slint | ||
WORKDIR $SLINT_INSTALL_DIR | ||
RUN wget --quiet -O - https://github.com/slint-ui/slint/releases/download/v$SLINT_VERSION/Slint-cpp-$SLINT_VERSION-Linux-x86_64.tar.gz | tar xvzf - --strip-components=1 | ||
|
||
# Set CMake prefix path | ||
ENV CMAKE_PREFIX_PATH=$SLINT_INSTALL_DIR |