From b218fc24921cb6cd042312e5ad1b0c0445ad037c Mon Sep 17 00:00:00 2001 From: "slack-samples[bot]" <169401055+slack-samples[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:13:00 +0000 Subject: [PATCH] Update .devcontainer configurations --- .devcontainer/Dockerfile | 24 ++++++++++++++++++++++ .devcontainer/README.md | 35 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 13 ++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/README.md create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..b4982c7 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,24 @@ +# Use the Ubtuntu base image +FROM ubuntu:22.04 + +# Download development tools +RUN apt-get update +RUN apt-get install -y curl +RUN apt-get install -y git +RUN apt-get install -y unzip + +# Run the container as a user +RUN useradd -m -s /bin/bash slackdev +RUN chown slackdev /usr/local/bin +USER slackdev + +# Install the project runtime +RUN curl -fsSL https://deno.land/install.sh | sh +RUN export DENO_INSTALL="/home/slackdev/.deno" +RUN export PATH="$DENO_INSTALL/bin:$PATH" + +# Set the working directory +WORKDIR /workspaces + +# Install the Slack CLI +RUN curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -d diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000..4ef3433 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,35 @@ +# .devcontainer + +A [development container][container] provides a predefined environment with +some tools needed for development, which can be useful in editors such as +[Visual Studio Code][vscode] or remote settings like [Codespaces][codespaces]. + +This specific container packages [the Slack CLI][cli] with the project runtime +and a few development tools. The `Dockerfile` details the container. + +## Editor extensions + +Modifications to an editor can be made with changes to the `devcontainer.json` +file: + +```diff +{ + "customizations": { + "vscode": { + "extensions": [ ++ "GitHub.copilot", + "denoland.vscode-deno", + "ms-azuretools.vscode-docker" + ], ++ "settings": { ++ "terminal.integrated.defaultProfile.linux": "zsh" ++ } + } + } +} +``` + +[codespaces]: https://github.com/features/codespaces +[cli]: https://api.slack.com/automation/cli +[container]: https://containers.dev/ +[vscode]: https://code.visualstudio.com/docs/devcontainers/containers diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..5c881bf --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,13 @@ +{ + "name": "Slack Platform", + "dockerFile": "Dockerfile", + "remoteUser": "slackdev", + "customizations": { + "vscode": { + "extensions": [ + "denoland.vscode-deno", + "ms-azuretools.vscode-docker" + ] + } + } +}