feat(docker): 🚀 add support for windows containers #10509
+260
−5
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.
Add Windows Container Support for Elastic Agent
What does this PR do?
This PR adds full support for building and deploying Elastic Agent as a Windows container, enabling deployment on Windows Server hosts with container support.
Note: Prior to this PR, Elastic Agent only supported Linux containers. All existing Docker documentation and Kubernetes manifests assume Linux containers. This PR adds Windows container support as a new deployment option for Windows Server hosts.
The implementation includes:
Core Build System Changes:
Windows Container Templates:
mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022
base image (~400MB) with proper Windows path handling and PowerShell Core supportCI/CD Integration (Buildkite):
Documentation:
Why is it important?
Business Value:
Technical Benefits:
Architecture Decision:
The implementation uses a multi-agent Buildkite pipeline to overcome the fundamental limitation that Docker cannot run Linux and Windows containers simultaneously:
Checklist
[ ] I have made corresponding change to the default configuration files(Not applicable - uses existing agent configuration)[ ] I have added tests that prove my fix is effective or that my feature works(Testing via CI/CD pipeline)./changelog/fragments
using the changelog tool[ ] I have added an integration test or an E2E test(Windows container integration tests would require Windows container infrastructure)Disruptive User Impact
No disruptive impact. This is a purely additive feature:
Users who want Windows containers can now use them; users who don't are unaffected.
How to test this PR locally
Prerequisites
Option 1: Full Build (requires Docker mode switching)
Phase 1 - Cross-compile (Linux containers):
Phase 2 - Package Docker (Windows containers):
Option 3: CI/CD Verification
The Buildkite pipeline will automatically build Windows containers when:
Verify the
package_elastic-agent-windows-docker
step succeeds and uploads artifacts tobuild/distributions/
.Related issues
Questions to ask yourself
How are we going to support this in production?
docker.elastic.co/elastic-agent
alongside Linux variantsHow are we going to measure its adoption?
How are we going to debug this?
docker logs <container-id>
docker exec
into container for interactive PowerShell debuggingWhat are the metrics I should take care of?
Additional Considerations:
PR labels:
backport-active-all