diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..cfa9ba68 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,41 @@ +FROM debian:12-slim as dev +ENV DEBIAN_FRONTEND noninteractive + +ARG APP_VERSION +LABEL version=$APP_VERSION + +ENV HOME /opt +RUN mkdir -p $HOME /build /opt + +#required packages +RUN apt-get update -qq && \ + apt-get install -y \ + build-essential wget git curl \ + libsigc++-2.0-dev libjansson-dev libcurl4-openssl-dev libluajit2-5.1-dev libsqlite3-dev \ + libcurl4-openssl-dev libusb-dev libow-dev imagemagick libev-dev libusb-1.0-0-dev \ + knxd knxd-dev googletest libuv1-dev libmosquitto-dev libmosquittopp-dev \ + libola-dev ola \ + unzip zip cmake automake autoconf libtool autopoint gettext \ + tar gzip zsh vim nano sudo zstd less gnupg ripgrep gdb cgdb + +RUN echo "export EDITOR=nano \n\ + export VISUAL=nano \n\ + export LS_OPTIONS='--color=auto' \n\ + eval "$(dircolors)" \n\ + alias ls='ls $LS_OPTIONS' \n\ + alias ll='ls $LS_OPTIONS -l' \n\ + " >> /etc/bash.bashrc + +RUN curl -fsSL https://starship.rs/install.sh | sh -s -- -y +RUN echo 'eval "$(starship init bash)"' >> /etc/bash.bashrc + +#better bash history search with up/down arrows +RUN echo "\n\ +## arrow up \n\ +\"\e[A\":history-search-backward \n\ +## arrow down \n\ +\"\e[B\":history-search-forward \n\ +\n\ +set show-all-if-ambiguous on \n\ +set completion-ignore-case on \n\ +" >> /etc/inputrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 57b7724d..945a2897 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,9 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the { - "name": "Calaos Dockerfile", - "context": "..", - "dockerFile": "../Dockerfile", + "name": "Debian12 calaos-server dev container", "build": { - "target": "dev" + "dockerfile": "Dockerfile" }, - "forwardPorts": [5454], -} \ No newline at end of file + + "mounts": [ + "source=extensionCache,target=/root/.vscode-server/extensions,type=volume" + ], + + // 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": [ 5454 ], + + // Configure tool-specific properties. + "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root", + + "runArgs": ["--privileged"] +} diff --git a/Dockerfile b/Dockerfile index a9aa7293..34d75305 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,14 @@ RUN mkdir -p $HOME /build /opt #required packages RUN apt-get update -qq && \ - apt-get install -y build-essential wget git curl libsigc++-2.0-dev \ - libjansson-dev libcurl4-openssl-dev libluajit2-5.1-dev libsqlite3-dev \ - libcurl4-openssl-dev libusb-dev libow-dev imagemagick libev-dev unzip \ - zip cmake automake autoconf libtool autopoint gettext libusb-1.0-0-dev \ + apt-get install -y \ + build-essential wget git curl \ + libsigc++-2.0-dev libjansson-dev libcurl4-openssl-dev libluajit2-5.1-dev libsqlite3-dev \ + libcurl4-openssl-dev libusb-dev libow-dev imagemagick libev-dev libusb-1.0-0-dev \ knxd knxd-dev googletest libuv1-dev libmosquitto-dev libmosquittopp-dev \ - libola-dev ola tar gzip + libola-dev ola \ + unzip zip cmake automake autoconf libtool autopoint gettext \ + tar gzip RUN curl -L https://github.com/calaos/calaos-web-app/archive/refs/tags/3.0.1.tar.gz --output webapp.tar.gz && \ tar xzvf webapp.tar.gz && \