From cf57f320de98c6f3283acb108463ee94977fadeb Mon Sep 17 00:00:00 2001 From: Kenneth Date: Thu, 15 Jan 2026 21:28:50 +0000 Subject: [PATCH] first commit Co-authored-by: Ona --- .devcontainer/Dockerfile | 36 ++++++++++++++++++ .devcontainer/devcontainer.json | 32 ++++++++++++++++ .github/workflows/build-devcontainer.yml | 48 ++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/workflows/build-devcontainer.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..745c834 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,36 @@ +FROM mcr.microsoft.com/devcontainers/javascript-node:24-bookworm + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + curl \ + ca-certificates \ + gnupg \ + lsb-release \ + ripgrep \ + && rm -rf /var/lib/apt/lists/* + +# Install latest neovim using pre-built binary +RUN curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz \ + && tar -C /opt -xzf nvim-linux-x86_64.tar.gz \ + && ln -s /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/nvim \ + && rm nvim-linux-x86_64.tar.gz + +# Install Bun as the node user +USER node +RUN curl -fsSL https://bun.sh/install | bash +ENV PATH="/home/node/.bun/bin:$PATH" + +# Switch back to root for any remaining setup +USER root + +# Ensure the node user owns their home directory +RUN chown -R node:node /home/node + +# Set the default user back to node +USER node + +# Set working directory +WORKDIR /workspace + +# Verify bun installation +RUN bun --version diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..ba9c1b2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +// The Dev Container format allows you to configure your environment. At the heart of it +// is a Docker image or Dockerfile which controls the tools available in your environment. +// +// See https://aka.ms/devcontainer.json for more information. +{ + "name": "Ona", + // This universal image (~10GB) includes many development tools and languages, + // providing a convenient all-in-one development environment. + // + // This image is already available on remote runners for fast startup. On desktop + // and linux runners, it will need to be downloaded, which may take longer. + // + // For faster startup on desktop/linux, consider a smaller, language-specific image: + // • For Python: mcr.microsoft.com/devcontainers/python:3.13 + // • For Node.js: mcr.microsoft.com/devcontainers/javascript-node:24 + // • For Go: mcr.microsoft.com/devcontainers/go:1.24 + // • For Java: mcr.microsoft.com/devcontainers/java:21 + // + // Browse more options at: https://hub.docker.com/r/microsoft/devcontainers + // or build your own using the Dockerfile option below. + "build": { + "context": ".", + "dockerfile": "Dockerfile" + } + // Features add additional features to your environment. See https://containers.dev/features + // Beware: features are not supported on all platforms and may have unintended side-effects. + // "features": { + // "ghcr.io/devcontainers/features/docker-in-docker": { + // "moby": false + // } + // } +} diff --git a/.github/workflows/build-devcontainer.yml b/.github/workflows/build-devcontainer.yml new file mode 100644 index 0000000..7e66870 --- /dev/null +++ b/.github/workflows/build-devcontainer.yml @@ -0,0 +1,48 @@ +name: Build Dev Container Image + +on: + push: + branches: + - main + paths: + - '.devcontainer/**' + workflow_dispatch: + +env: + REGISTRY: cr.nym.sh + IMAGE_NAME: kennethnym/devcontainer-bun + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=raw,value=latest + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: .devcontainer + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}