Skip to content

Repository files navigation

1Panel v2 Builder (DIY Edition)

中文 Upstream Docker License

A community-maintained, pure Docker-based build system for 1Panel v2.

This project democratizes the build process of 1Panel, allowing developers and advanced users to compile the full 1Panel stack (Core + Agent + Frontend) from source without needing a complex local development environment.

📖 Table of Contents

❓ Why use this?

The official 1Panel build process involves multiple languages (Go, Node.js) and tools (GoReleaser). This repository wraps all that complexity into a single Dockerfile. Use this if you:

  • Want to customize 1Panel (modify source code, change assets).
  • Need to run 1Panel on unsupported architectures (e.g., specific RISC-V boards).
  • Want to verify the build process for security auditing.

✨ Key Features

  • 🐳 Zero Local Dependencies: No Go, Node.js, or complex toolchains required on your host machine.
  • 🖥️ Multi-Architecture Ready: Native cross-compilation for amd64, arm64, armv7, ppc64le, s390x, loong64, and riscv64.
  • 🔄 Cross-Version Compatible: Smart dependency handling ensures you can build both the latest v2.x and older versions.
  • 📦 Standardized Output: Produces artifacts identical in structure to official releases, ready for production use.

📂 Project Structure

diyv2/
├── Dockerfile                  # Master build definition
├── scripts/
│   └── download_resources.sh   # Universal resource fetcher (keeps build robust)
└── README.md                   # Documentation

🚀 Quick Start

Prerequisites

  • Docker installed and running.
  • Git (to clone this repo).

Step-by-Step Build

  1. Clone the Repository

    git clone https://github.com/your-repo/1panel-diy.git
    cd 1panel-diy/diyv2
  2. Build the Builder Image Replace v2.0.13 with your desired version.

    docker build -f Dockerfile \
      --build-arg VERSION=v2.0.13 \
      -t 1panel-v2-builder .
  3. Run Build & Export Artifacts This command compiles the code inside a container and saves the results to dist/.

    docker run --rm -v "$(pwd)/dist:/dist" 1panel-v2-builder
  4. Verify Output Your packages are now ready in dist/:

    ls -lh dist/

⚙️ Configuration

Customize your build by passing --build-arg to the docker build command.

Build Argument Default Description
VERSION v2.0.13 The Git tag or branch of 1Panel to build.
TARGET_ARCHES All Supported Space-separated target architectures (e.g., "amd64 arm64").
INSTALLER_REF v2 The branch/tag of the installer repository to use for scripts.
GO_VERSION auto in CI Golang version. CI resolves it from upstream core/agent go.mod; manual builds may still override it explicitly.
NODE_VERSION 20 Node.js version for frontend assets.

Note on Architectures: Default list is amd64 arm64 armv7 ppc64le s390x loong64 riscv64.

📦 Output Artifacts

The generator produces standard tarballs that look exactly like official releases:

dist/
├── 1panel-v2.0.13-linux-amd64.tar.gz  # The installation package
└── 1panel-v2.0.13-linux-amd64.tar.gz.sha256

Inside the tarball:

  • /1panel-core: Backend server binary.
  • /1panel-agent: Agent binary.
  • /1pctl: CLI management tool.
  • /install.sh: Standard install script.
  • And all necessary service files/language packs.

🤖 CI/CD Integration

This project is CI-ready. The included .github/workflows/build.yml:

  1. Runs Daily: Checks 1Panel official releases.
  2. Auto-Builds: If a new official version is found that hasn't been built here, it triggers a build.
  3. Releases: Automatically creates a GitHub Release with the artifacts.

📄 License

This project is open-sourced under the Apache License 2.0. See the LICENSE file for more details.


Made with ❤️ by the Open Source Community

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages