Skip to content

Commit

Permalink
added vscode container support
Browse files Browse the repository at this point in the history
  • Loading branch information
dliess committed Mar 9, 2022
1 parent e8ae727 commit 253a6ae
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,58 @@
FROM debian:bullseye

# Users and passwords
ARG BUILD_USER=build-user
ARG UID=1000
ARG GID=1000
ARG BUILD_USER_PWD=pwd

RUN rm -rf /var/lib/apt/lists/*

# Generate and set locale
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y locales \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales

RUN locale-gen --purge en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# Package installs
RUN apt-get update && apt-get install -y \
sudo \
cmake \
clang-format \
ninja-build \
g++ \
git \
libasound2-dev \
&& rm -rf /var/lib/apt/lists/*

# some utilities for runtime
RUN apt-get update && apt-get install -y \
vim \
zsh \
curl \
wget \
&& rm -rf /var/lib/apt/lists/*

#RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Create group and user
RUN groupadd --gid=$GID $BUILD_USER
RUN useradd --create-home --shell /bin/bash $BUILD_USER --uid=$UID -g $BUILD_USER
RUN echo "$BUILD_USER:$BUILD_USER_PWD" | chpasswd
RUN usermod -aG sudo $BUILD_USER

USER $BUILD_USER
WORKDIR /home/$BUILD_USER

RUN wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | zsh || true
RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="gentoo"/g' ~/.zshrc




27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,27 @@
{
"name": "RtMidiBuildEnv",
"build": {
"dockerfile": "Dockerfile"
},
"runArgs" : [
"--rm", "--privileged",
"--group-add", "audio"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/zsh",
"terminal.integrated.detectLocale": "off"
},
"mounts" : [
// Enable this if you need your .ssh files imported
//"type=bind,source=${env:HOME}/.ssh,target=/home/build-user/.ssh"
"type=bind,source=/dev,target=/dev"
],
"extensions": [
"eamodio.gitlens",
"ms-vscode.cpptools",
"twxs.cmake",
"ms-vscode.cmake-tools",
"jebbs.plantuml",
"xaver.clang-format"
]
}

0 comments on commit 253a6ae

Please sign in to comment.