forked from dcflachs/compose_plugin
-
Notifications
You must be signed in to change notification settings - Fork 4
Implement Import Wizard to easily migrate Docker Containers to Compose #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mstrhakr
wants to merge
40
commits into
dev
Choose a base branch
from
feat/composerize
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,112
−2
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
b2024c1
feat(import): add Docker Manager container import functionality and p…
mstrhakr 9575680
fix(escape): replace escapeHtml with composeEscapeHtml for container …
mstrhakr 1dd0bc2
feat(ui): enhance dropdown menu styling and improve YAML handling in …
mstrhakr 536cb6d
Add Import Wizard styles and unit tests for backend functions
mstrhakr 7cb4b60
fix(tests): update require path for Util.php in ImportWizardTest
mstrhakr 7cd7fe2
feat(import): add Import Wizard documentation for converting Docker M…
mstrhakr ed91dc0
feat(import): update Import Wizard to support Basic/Advanced modes an…
mstrhakr 3d20a4b
fix(styles): update ComboButton and EditorModal styles for improved t…
mstrhakr 2661187
feat(import): refactor Import Wizard to use checkbox for mode toggle …
mstrhakr 9f865cc
fix: restore .editor-validation.error CSS rule and fix nesting issues
mstrhakr f6100c9
docs: standardize wizard stage count to 5-stage across all files
mstrhakr 7b9713d
fix: preserve numeric types in yamlQuoteValue()
mstrhakr 4242df7
fix: disable Import button when compose validation fails
mstrhakr 5332557
fix: check file_put_contents return values before stopping containers
mstrhakr 7a8a3d7
fix: add rel="noopener noreferrer" to WebUI target="_blank" link
mstrhakr e0d0ead
fix: reject empty compose content and cleanup orphan stack folder on …
mstrhakr ac45d82
fix: use structured data in port conflict detection to support port r…
mstrhakr d2dd2cb
fix: auto-seed external networks from discovered containers and rende…
mstrhakr 3c52165
fix: preserve healthcheck test type (CMD vs CMD-SHELL) when command i…
mstrhakr be7ca91
fix: use monotonic IDs for dependency rows to prevent index collision
mstrhakr d38c46b
test: add port range conflict test for detectPortConflicts
mstrhakr 8ddc112
test: add exec action tests for all 4 import wizard actions
mstrhakr 76f574b
fix(tests): trim whitespace from imported YAML and environment files …
mstrhakr 7441b4b
fix(ports): handle IPv6 port binds in parsePortMapping and port gener…
mstrhakr 3c53389
fix(import): guard against name conflict when starting stack without …
mstrhakr ade5beb
fix(ui): disable network attachments for bridge network mode
mstrhakr 9de43b0
fix(docs): rename docker-compose.yml label to compose.yaml in UI and …
mstrhakr dae4ec5
fix: avoid redundant docker stop before docker rm -f in import transfer
mstrhakr d0abea5
fix: remove dead generateImportPreview action
mstrhakr 231526a
fix: prevent __originalTestType leaking into generated compose YAML
mstrhakr 8eddc96
fix: escape tab chars in yamlQuoteValue + add service-group comments …
mstrhakr aaa6988
fix: replace inline onclick XSS vectors with data-attr + jQuery event…
mstrhakr 9e97395
cleanup: remove unused .iw-hidden CSS rule
mstrhakr b8f3dc3
fix: improve Docker network listing and add buildImportServicesFromId…
mstrhakr 88bed16
fix: refactor container import logic to use buildImportServicesFromId…
mstrhakr 7810930
fix: update attachStackNet logic to simplify network mode handling in…
mstrhakr 2798f49
fix: add missing DockerTemplates and xmlToCommand messages to phpstan…
mstrhakr 90bf74d
fix: remove error message for empty Docker Manager containers in impo…
mstrhakr 3468fde
fix: add loading spinner overlay during stack import process
mstrhakr a0f00fd
feat(import): enhance network configuration to support static IP addr…
mstrhakr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| # Import Wizard | ||
|
|
||
| The Import Wizard lets you convert existing Docker Manager containers into a Compose Manager stack with a guided 5-stage workflow. | ||
|
|
||
| ## Where to Find It | ||
|
|
||
| 1. Go to **Docker -> Compose**. | ||
| 2. Click **Import from Docker Manager**. | ||
| 3. Select one or more existing containers to import. | ||
|
|
||
| ## What the Wizard Imports | ||
|
|
||
| For each selected container, Compose Manager reads Docker metadata and converts it into Compose service definitions, including: | ||
|
|
||
| - Image name | ||
| - Container name | ||
| - Ports | ||
| - Environment variables | ||
| - Volumes and bind mounts | ||
| - Labels (including Unraid-specific WebUI/icon labels) | ||
| - Existing healthcheck (if present) | ||
| - Network mode and network attachments | ||
|
|
||
| The wizard can also auto-detect likely healthchecks for common services when no healthcheck exists. | ||
|
|
||
| ## 5-Stage Workflow | ||
|
|
||
| ### Stage 1: Select Containers | ||
|
|
||
| - Shows import candidates from Docker Manager. | ||
| - You can select individual containers or use **Select All**. | ||
| - At least one container is required to continue. | ||
|
|
||
| ### Stage 2: Select Options | ||
|
|
||
| Configure stack-wide options: | ||
|
|
||
| - **Stack Name** (required) | ||
| - **Create Stack Network** and network name | ||
| - **External Networks** to make available during import | ||
| - Post-import behavior: | ||
| - **Stop original containers** | ||
| - **Remove original containers** | ||
| - **Start imported stack** | ||
|
|
||
| Notes: | ||
|
|
||
| - If **Remove original containers** is enabled, **Stop original containers** is enforced. | ||
| - The stack name is sanitized to a safe folder-style name for preview. | ||
|
|
||
| ### Stage 3: Configure Containers | ||
|
|
||
| Per-service configuration: | ||
|
|
||
| - Container name (must be unique and non-empty) | ||
| - Network mode (default/bridge/host/none) | ||
| - Network attachments (stack network and selected external networks) | ||
| - Healthcheck command and timing settings | ||
| - Read-only port view with conflict indicators | ||
|
|
||
| Validation behavior: | ||
|
|
||
| - Duplicate or empty container names disable **Next**. | ||
| - Host port conflicts are highlighted so you can review them before import. | ||
|
|
||
| ### Stage 4: Configure Dependencies | ||
|
|
||
| Define Compose `depends_on` relationships between imported services: | ||
|
|
||
| - Add dependencies service-by-service | ||
| - Choose condition: | ||
| - `service_started` | ||
| - `service_healthy` (available only when target service has a healthcheck) | ||
|
|
||
| Safety checks: | ||
|
|
||
| - Dependency cycles are detected and block progress. | ||
| - A calculated startup order preview is shown when possible. | ||
|
|
||
| ### Stage 5: Review & Import | ||
|
|
||
| Compose Manager generates the configuration and presents a final review screen with: | ||
|
|
||
| - `compose.yaml` (with parse validation) | ||
| - `.env` content (when needed) | ||
| - Override content for labels/icons (when needed) | ||
| - Validation result and any parse errors | ||
| - Import summary (services, networks, healthchecks, dependencies) | ||
|
|
||
| Click **Import** to write files and complete the transfer. | ||
|
|
||
| ## What Happens on Import | ||
|
|
||
| When you confirm import: | ||
|
|
||
| 1. A new stack is created in the configured projects directory. | ||
| 2. Generated files are written to that stack folder. | ||
| 3. Selected source containers can be stopped and/or removed (based on your options). | ||
| 4. The stack opens in the editor. | ||
| 5. If selected, Compose Manager runs **Compose Up** for the imported stack. | ||
|
|
||
| ## Tips and Best Practices | ||
|
|
||
| - Start with related containers that should live in the same stack. | ||
| - Review network mode carefully: `host`/`none` intentionally limit network attachments. | ||
| - Keep healthchecks when possible; they improve dependency sequencing and startup reliability. | ||
| - Resolve any port conflicts before starting the new stack if services must run in parallel. | ||
| - If this is a production workload, take a backup before removing original containers. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### No containers appear in Stage 1 | ||
|
|
||
| - Verify containers exist in Docker Manager and are readable by the plugin. | ||
|
|
||
| ### Cannot continue from Stage 3 | ||
|
|
||
| - Fix duplicate or empty container names. | ||
|
|
||
| ### Cannot continue from Stage 4 | ||
|
|
||
| - Remove circular dependencies until the cycle warning is gone. | ||
|
|
||
| ### Import fails at the final step | ||
|
|
||
| - Re-check stack name validity. | ||
| - Re-open the wizard and re-import if source containers changed during the session. | ||
| - Check Unraid syslog/plugin logs for server-side error details. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.