From bd38074d7ccd334801bc82116069cc3705c9b1b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20D=C3=B6ll?=
Date: Fri, 2 May 2025 07:35:45 +0200
Subject: [PATCH] add development container support
---
.devcontainer/Dockerfile | 13 +++++++++++++
.devcontainer/devcontainer.json | 29 ++++++++++++++++++++++++++++
.devcontainer/post-create-command.sh | 7 +++++++
README.md | 7 ++++++-
4 files changed, 55 insertions(+), 1 deletion(-)
create mode 100644 .devcontainer/Dockerfile
create mode 100644 .devcontainer/devcontainer.json
create mode 100755 .devcontainer/post-create-command.sh
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 000000000..6b59d66d9
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,13 @@
+# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu/.devcontainer/base.Dockerfile
+
+# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
+ARG VARIANT="jammy"
+FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
+
+# Install additional OS packages, if needed.
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends ca-certificates
+
+# [Optional] Uncomment this section to install additional OS packages.
+# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+# && apt-get -y install protobuf-compiler
\ No newline at end of file
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000..6fb6c3490
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,29 @@
+{
+ "build": {
+ "dockerfile": "Dockerfile",
+ // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
+ // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
+ "args": {
+ "VARIANT": "ubuntu-22.04"
+ }
+ },
+ "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
+ "postCreateCommand": "bash .devcontainer/post-create-command.sh",
+ "features": {
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {},
+ "ghcr.io/devcontainers/features/git-lfs:1": {},
+ "ghcr.io/devcontainers/features/github-cli:1": {},
+ "ghcr.io/devcontainers/features/go:1": {},
+ "ghcr.io/katallaxie/devcontainer-features/buf-cli:1": {},
+ "ghcr.io/guiyomh/features/mage:0": {}
+ },
+ "customizations": {
+ "vscode": {
+ "extensions": [
+ "authzed.spicedb-vscode",
+ "golang.go",
+ "ms-azuretools.vscode-docker"
+ ]
+ }
+ }
+ }
\ No newline at end of file
diff --git a/.devcontainer/post-create-command.sh b/.devcontainer/post-create-command.sh
new file mode 100755
index 000000000..e5f3067e4
--- /dev/null
+++ b/.devcontainer/post-create-command.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+# This script is executed after the creation of a new project.
+
+# Install goreleaser pro
+echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
+sudo apt update
+sudo apt install goreleaser-pro
\ No newline at end of file
diff --git a/README.md b/README.md
index d4c20eb99..58a45d4fc 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,6 @@
-
@@ -36,6 +35,12 @@
+
+
+
+
+
+
## What is SpiceDB?