Skip to content

Commit

Permalink
Add dockerfile for dev env in vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Jan 16, 2024
1 parent 990d04a commit 8e2b684
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 11 deletions.
41 changes: 41 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
28 changes: 22 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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],
}

"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"]
}
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit 8e2b684

Please sign in to comment.