From 17a2e59190a6b68af451e58c04a64aabb632b021 Mon Sep 17 00:00:00 2001 From: haixuantao Date: Thu, 13 Mar 2025 15:51:00 +0100 Subject: [PATCH] Improve docker registry --- .github/workflows/docker-image.yml | 23 ++++++++----- docker/minimal/README.md | 44 ------------------------- docker/{minimal => slim}/Dockerfile | 0 docker/slim/README.md | 51 +++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 52 deletions(-) delete mode 100644 docker/minimal/README.md rename docker/{minimal => slim}/Dockerfile (100%) create mode 100644 docker/slim/README.md diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 1f196ee1..9f7c6555 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,21 +1,28 @@ -name: Docker Image CI +name: Docker Image CI/CD on: push: - branches: [ "main" ] + branches: ["main"] paths: - "docker/**" pull_request: - branches: [ "main" ] paths: - "docker/**" jobs: - build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build docker/minimal --tag dora-minimal:$(date +%s) + - uses: actions/checkout@v4 + + - name: "Login to GitHub Container Registry" + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + + - name: Build the Docker image + run: | + docker build docker/slim --tag ghcr.io/dora-rs/dora-slim:latest + docker push ghcr.io/dora-rs/dora-slim:latest diff --git a/docker/minimal/README.md b/docker/minimal/README.md deleted file mode 100644 index 9dea1e31..00000000 --- a/docker/minimal/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Minimal Dora Docker Environment - -This Dockerfile provides a minimal environment for running Dora applications with Python and uv package manager. - -## What's Included - -- Python 3.12 -- Rust (required for Dora) -- uv package manager -- Latest Dora release - -## Building the Image - -```bash -docker build . -t dora-minimal -``` - -## Running the Container - -```bash -docker run -it --rm dora-minimal -``` - -## Running not in interactive - -```bash -docker run --rm dora-minimal dora --help -``` - -## Running with privilege as well as USB connection - -```bash -docker run --rm --device=/dev/ttyUSB0 dora-minimal dora --help -``` - -## Usage - -Once inside the container, you can: - -- Run Dora commands: `dora --help` -- Use uv for package management: `uv install numpy` -- Develop and test your Dora applications - -This container is designed to provide a consistent environment for Dora development without requiring complex setup on the host machine. diff --git a/docker/minimal/Dockerfile b/docker/slim/Dockerfile similarity index 100% rename from docker/minimal/Dockerfile rename to docker/slim/Dockerfile diff --git a/docker/slim/README.md b/docker/slim/README.md new file mode 100644 index 00000000..2f20e4c0 --- /dev/null +++ b/docker/slim/README.md @@ -0,0 +1,51 @@ +# slim Dora Docker Environment + +This Dockerfile provides a slim environment for running Dora applications with Python and uv package manager. + +## What's Included + +- Python 3.12 +- Rust (required for Dora) +- uv package manager +- Latest Dora release + +## Building the Image + +```bash +docker build . -t dora-slim +``` + +## Running the Container + +```bash +docker run -it --rm --device=/dev/video0 dora-slim +``` + +## Running not in interactive + +```bash +docker run --rm dora-slim dora --help +``` + +## Running with privilege as well as USB connection + +```bash +docker run --rm --device=/dev/video0 dora-slim dora --help +``` + +## Usage + +Once inside the container, you can: + +```bash +## Create a virtual environment +uv venv --seed -p 3.11 + +## Install nodes dependencies of a remote graph +dora build https://raw.githubusercontent.com/dora-rs/dora/refs/heads/main/examples/object-detection/yolo.yml --uv + +## Run yolo graph +dora run yolo.yml --uv +``` + +This container is designed to provide a consistent environment for Dora development without requiring complex setup on the host machine.