From d3bff90e15cafb3f527706c1053440be8fa90dde Mon Sep 17 00:00:00 2001 From: retrobit Date: Wed, 31 Jan 2024 12:26:24 -0700 Subject: [PATCH] Dev Container support w/Dockerfile (#23) Co-authored-by: retrobit <6226450+retrobit@users.noreply.github.com> --- .devcontainer/Dockerfile | 13 +++++++++++++ .devcontainer/devcontainer.json | 32 ++++++++++++++++++++++++++++++++ .github/dependabot.yml | 12 ++++++++++++ .gitignore | 6 ++++++ 4 files changed, 63 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/dependabot.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..7374d025 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,13 @@ +# syntax=docker/dockerfile:1 + +# Dev Container Template (https://containers.dev/templates) based on latest Debian "bookworm" release or use vanilla Debian from Docker Hub instead +FROM mcr.microsoft.com/devcontainers/base:bookworm +# FROM debian:bookworm + +# Update, upgrade, and install necessary packages +RUN sudo apt update && sudo apt upgrade && sudo apt install -y qtbase5-dev + +# Make (compile) and install Skyscraper +RUN QT_SELECT=5 +# These can not be done in a Dev Container, as workspace doesn't exist until after Docker container is created from image, so commands are unaware of source files. Instead, do in `postCreateCommand` of `devcontainer.json`. +# RUN qmake && make -j$(nproc) && sudo make install diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..d9d36111 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "Debian", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + // "image": "mcr.microsoft.com/devcontainers/base:bookworm" + "build": { + // Path is relative to the `devcontainer.json` file + "dockerfile": "Dockerfile" + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-azuretools.vscode-docker" + ] + } + }, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" + + // Actions that are run after the container is created + "postCreateCommand": "qmake && make -j$(nproc) && sudo make install" +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f33a02cd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.gitignore b/.gitignore index 6a204c79..346bc8cc 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,9 @@ packages *-packages target build + +# macOS +.DS_Store + +# VS Code +*.code-workspace