mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[PR #7] [MERGED] feat: Add Docker default image configuration support #115
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/7
Author: @asdek
Created: 2/1/2025
Status: ✅ Merged
Merged: 2/1/2025
Merged by: @asdek
Base:
master← Head:5-issue-with-correct-choose-docker-image📝 Commits (2)
26ec423feat: Add Docker default image configuration supportfe378a9fix: normalize Docker image name to lowercase📊 Changes
7 files changed (+84 additions, -17 deletions)
View changed files
📝
.env.example(+1 -0)📝
Dockerfile(+9 -0)📝
backend/pkg/config/config.go(+6 -5)📝
backend/pkg/docker/client.go(+61 -7)📝
backend/pkg/providers/providers.go(+3 -2)📝
backend/pkg/templates/prompts/image_chooser.tmpl(+3 -3)📝
docker-compose.yml(+1 -0)📄 Description
Changelog
.env.exampleto includeDOCKER_DEFAULT_IMAGEconfigurationdocker-compose.ymlto pass default image environment variableDockerfilewith additional build essentialsProblem
When users attempt to create flow workers without specifying a valid Docker image, they encounter errors due to invalid or improperly formatted image names. This often results in container creation failures with error messages like:
This issue arises because the AI model may generate an incorrect or non-lowercase Docker image name, leading to failures in container instantiation. It affects the user experience by interrupting workflows and requiring manual intervention to correct image names.
Solution
This change introduces a configurable default Docker image through the
DOCKER_DEFAULT_IMAGEenvironment variable. Key aspects of the solution include:DOCKER_DEFAULT_IMAGEto.env.exampleand updateddocker-compose.ymlto pass this environment variable to the backend service.These changes improve robustness in container creation, reduce errors related to image selection, and enhance the overall user experience by providing sensible defaults and better guidance.
Partially closes #5
Type of Change
Test Steps
DOCKER_DEFAULT_IMAGE=alpine:latestin the.envfile.docker-compose up --build.alpine:latestimage and the container is created successfully.Test Results
alpine:latestwithout crashing.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.