From 2f6c7766a8d6f1e77e96583f9b4b4ddcf05ef8b9 Mon Sep 17 00:00:00 2001 From: Koki Takahashi Date: Tue, 26 Nov 2024 14:58:56 +0000 Subject: [PATCH] Configure devcontainer slackbot container to respect .tool-versions configurations --- .devcontainer/slackbot/Dockerfile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.devcontainer/slackbot/Dockerfile b/.devcontainer/slackbot/Dockerfile index 78fee2e8..6c5698c5 100644 --- a/.devcontainer/slackbot/Dockerfile +++ b/.devcontainer/slackbot/Dockerfile @@ -1,11 +1,21 @@ -FROM node:20-bookworm +FROM debian:bookworm-slim RUN apt-get update -y && \ # Install build dependencies for node-canvas # https://github.com/Automattic/node-canvas/wiki/Installation%3A-Ubuntu-and-other-Debian-based-systems apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev -y && \ # Install other dependencies - apt-get install git bash gnupg -y && \ + apt-get install git curl bash gnupg -y && \ + # Setup asdf + git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1 && \ + echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc && \ + echo ". $HOME/.asdf/completions/asdf.bash" >> ~/.bashrc && \ + echo "export ASDF_DIR=\"$HOME/.asdf\"" >> ~/.profile && \ + echo ". \"$HOME/.asdf/asdf.sh\"" >> ~/.profile && \ + . ~/.profile && \ + # Install asdf plugins + asdf plugin add nodejs && \ + asdf plugin add rust && \ # Install ngrok curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc | tee /etc/apt/trusted.gpg.d/ngrok.asc > /dev/null && \ echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | tee /etc/apt/sources.list.d/ngrok.list && \ @@ -15,11 +25,12 @@ RUN apt-get update -y && \ # https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/debian/dist_package_versions.json;l=39-75;drc=df14ef63b2bc818472205e50ad32a3511db4edb2 curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg && \ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google.list && \ - apt-get update && \ + apt-get update -y && \ apt-get install google-chrome-stable fonts-ipafont-gothic libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libdrm2 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libudev1 libuuid1 libx11-6 libx11-xcb1 libxcb-dri3-0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxkbcommon0 libxrandr2 libxrender1 libxshmfence1 libxss1 libxtst6 -y && \ # Install slackbot npm dependencies - git clone https://github.com/tsg-ut/slackbot.git --branch master --single-branch --recursive --depth 1 /code && \ + git clone https://github.com/tsg-ut/slackbot.git --branch asdf --single-branch --recursive --depth 1 /code && \ cd /code && \ + asdf install && \ npm install && \ # Cleanup apt-get clean && \