My Personal DevContainer base image
  • Dockerfile 56.5%
  • PowerShell 43.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
merith-tk f8471ea6f9
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 2m58s
Update on-commit workflow to also push latest
2026-06-29 14:45:06 -07:00
.devcontainer convert oci/template to devcontainer/template 2025-08-09 08:32:25 -07:00
.forgejo/workflows Update on-commit workflow to also push latest 2026-06-29 14:45:06 -07:00
drop-in Replace tag-triggered build with weekly cron, clean up docs 2026-06-29 14:02:23 -07:00
.dockerignore convert oci/template to devcontainer/template 2025-08-09 08:32:25 -07:00
.gitignore Replace tag-triggered build with weekly cron, clean up docs 2026-06-29 14:02:23 -07:00
Dockerfile fix incorrect login shell 2026-06-29 14:41:40 -07:00
DROP-IN.md Replace tag-triggered build with weekly cron, clean up docs 2026-06-29 14:02:23 -07:00
Readme.md Replace tag-triggered build with weekly cron, clean up docs 2026-06-29 14:02:23 -07:00

OCI Dev Container Template

Overview

This repo is a template for creating containerized development environments that are compatible with both VSCode Dev Containers and automated OCI registry publishing workflows.

Features

VSCode Dev Container Support

  • Base Image: Ubuntu 22.04 with development tools
  • Non-root User: Configured with vscode user for security
  • Pre-installed Tools: Git, build tools, network utilities, Go 1.23.4 (multi-arch: amd64/arm64)
  • VSCode Extensions: Docker, GitHub Actions, YAML, PowerShell, Go language support
  • Dev Container Features: Git, Docker-in-Docker, GitHub CLI

Automated Build Workflows

Two Forgejo Actions workflows automate Docker image building and publishing:

  1. On Commit to Main (build-on-commit.yml)

    • Trigger: Activates on commits to the main branch (tags are excluded).
    • Purpose: Builds and publishes a Docker image tagged with the commit SHA and nightly.
  2. Weekly (build-weekly.yml)

    • Trigger: Runs every Monday at 12:00 (cron 0 12 * * 1).
    • Purpose: Builds and publishes a Docker image tagged as latest.

Getting Started

Using as a Dev Container

  1. Prerequisites:

    • VSCode with Dev Containers extension installed
    • Docker Desktop running
  2. Open in Dev Container:

    • Clone this repository
    • Open in VSCode
    • When prompted, click "Reopen in Container"
    • Or use Command Palette: "Dev Containers: Reopen in Container"
  3. Manual Setup:

    git clone <your-repo-url>
    cd oci-dev-container-template
    code .
    

Using in Other Projects

🚀 Drop-in Setup (Recommended)

One command in any repo:

mkdir -p .devcontainer && curl -o .devcontainer/devcontainer.json https://git.merith.xyz/oci/devcontainer/raw/branch/main/drop-in/devcontainer.json

Then open in VSCode → "Reopen in Container" → Done!

📖 See DROP-IN.md for setup instructions and customization options.

Using for Auto-Build

  1. Clone the Repository: Get a local copy of this repository.
  2. Modify Dockerfile: Update the Dockerfile for your application needs.
  3. Configure Secrets: Add required secrets to your repository:
    • OCI_TOKEN: Your OCI registry token
    • OCI_USER: Your OCI registry username
  4. Push Changes: Push changes to the main branch, or wait for the weekly build.
  5. Check Workflow Status: View the Actions tab to monitor workflow runs.

Customization

Dev Container Configuration

  • Modify .devcontainer/devcontainer.json to:
    • Add additional VSCode extensions
    • Configure port forwarding
    • Add post-creation commands
    • Customize container features

Dockerfile Enhancement

  • Add language-specific tools and runtimes
  • Install additional development dependencies
  • Configure environment variables
  • Set up project-specific tooling

Directory Structure

.
├── .devcontainer/
│   └── devcontainer.json       # Dev container configuration
├── .forgejo/workflows/         # CI build workflows
├── drop-in/                    # Simple setup for other projects
│   ├── devcontainer.json           # Minimal drop-in config
│   └── setup-devcontainer.ps1      # Windows setup script
├── Dockerfile                  # Container definition
├── .dockerignore                # Docker build optimization
├── DROP-IN.md                   # Simple drop-in setup guide
└── Readme.md                    # This file

Notes

  • The container supports multi-platform builds if necessary
  • Development tools are pre-installed for immediate productivity
  • Non-root user configuration enhances security
  • Docker-in-Docker support enables container development within the dev container