My Personal DevContainer base image
Find a file
Merith cd15c7e291
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 3m24s
fix golang multiarch
2025-08-09 08:39:40 -07:00
.copilot fix golang multiarch 2025-08-09 08:39:40 -07:00
.devcontainer convert oci/template to devcontainer/template 2025-08-09 08:32:25 -07:00
.forgejo/workflows Initial commit 2025-08-09 16:04:46 +01:00
drop-in convert oci/template to devcontainer/template 2025-08-09 08:32:25 -07:00
.dockerignore convert oci/template to devcontainer/template 2025-08-09 08:32:25 -07:00
Dockerfile fix golang multiarch 2025-08-09 08:39:40 -07:00
DROP-IN.md fix golang multiarch 2025-08-09 08:39:40 -07:00
Readme.md fix golang multiarch 2025-08-09 08:39:40 -07:00

OCI Dev Container Template

Overview

This### Using in Other Projects

🚀 Drop-in Setup:

One command in any repo:

mkdir -p .devcontainer && curl -o .devcontainer/devcontainer.json https://raw.githubusercontent.com/your-username/oci-dev-container-template/main/drop-in/devcontainer.json

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

**📖 See DROP-IN.md for setup instructions and customization options.**as 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.21.6 (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 GitHub Actions workflows automate Docker image building and publishing:

  1. On Commit to Main

    • Trigger: Activates on commits to the main branch (tags are excluded).
    • Purpose: Builds and publishes a Docker image for each commit.
  2. On Tag Push

    • Trigger: Activates when a new tag is pushed.
    • Purpose: Builds and publishes a Docker image for the tag and tags it 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

<EFBFBD> FASTEST: Drop-in Setup (Recommended)

One command in any repo:

mkdir -p .devcontainer && curl -o .devcontainer/devcontainer.json https://raw.githubusercontent.com/your-username/oci-dev-container-template/main/drop-in/devcontainer.json

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

📖 See DROP-IN.md for the ultimate simple setup guide.

📖 See USAGE.md for advanced usage and customization options.

Quick options:

  • Method 1: Reference pre-built image directly (fastest)
  • Method 2: Extend with project-specific Dockerfile
  • Method 3: Build from Git repository source

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 create a new tag.
  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
├── .copilot/                   # Agent logging and context
├── 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

License

This project is licensed under the MIT License. See the LICENSE file for details.