{"id":27063627,"url":"https://github.com/docker/communitytools-image2docker-win","last_synced_at":"2025-04-05T16:01:50.008Z","repository":{"id":144837431,"uuid":"67834460","full_name":"docker-archive/communitytools-image2docker-win","owner":"docker-archive","description":null,"archived":true,"fork":false,"pushed_at":"2022-04-24T16:55:19.000Z","size":132,"stargazers_count":304,"open_issues_count":47,"forks_count":78,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-07-31T05:06:18.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docker-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-09T21:40:20.000Z","updated_at":"2024-07-25T09:05:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e1cd36b-6dac-4515-a90b-763d15716449","html_url":"https://github.com/docker-archive/communitytools-image2docker-win","commit_stats":null,"previous_names":["docker/communitytools-image2docker-win"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fcommunitytools-image2docker-win","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fcommunitytools-image2docker-win/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fcommunitytools-image2docker-win/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fcommunitytools-image2docker-win/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docker-archive","download_url":"https://codeload.github.com/docker-archive/communitytools-image2docker-win/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361593,"owners_count":20926641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-05T16:01:40.039Z","updated_at":"2025-04-05T16:01:49.977Z","avatar_url":"https://github.com/docker-archive.png","language":"PowerShell","readme":"# Image2Docker\n\n`Image2Docker` is a PowerShell module which ports existing Windows application workloads to Docker. It supports multiple application types, but the initial focus is on [IIS and ASP.NET apps](docs/IIS.md). You can use `Image2Docker` to extract [ASP.NET websites from a VM](https://blog.docker.com/2016/12/convert-asp-net-web-servers-docker-image2docker/) - or from the local machine or a remote machine. Then so you can run your existing apps in Docker containers on Windows, with no application changes.\n\n## Documentation\n\n* [IIS and ASP.NET](docs/IIS.md)\n\n## Introduction\n\nThis project aims to provide a framework to simplify the creation of Dockerfiles for Windows Docker\nimages, based upon analysis of existing Windows machines.\n\nMicrosoft Windows 10 and Windows Server 2016 introduce new capabilities for containerizing applications. \nThere are two types of container formats supported on the Microsoft Windows platform:\n\n- **Hyper-V Containers** - Containers with a dedicated kernel and stronger isolation from other containers\n- **Windows Server Containers** - application isolation using process and namespace isolation, and a shared kernel with the container host\n\n## Prerequisites\n\nYou do not need Docker installed to use Image2Docker - the only requirement is PowerShell 5.0.\n\n`Image2Docker` generates a [Dockerfile](https://docs.docker.com/engine/reference/builder/) which you can build into a Docker image. The system running the `ConvertTo-Dockerfile` command does not need Docker installed, but you will need [Docker setup on Windows](https://github.com/docker/labs/blob/master/windows/windows-containers/Setup.md) to build images and run containers.\n\n## Installation\n\nInstalling this PowerShell module from the PowerShell Gallery is very easy. In an administrative prompt run:\n\n```\nInstall-Module Image2Docker\nImport-Module Image2Docker\n```\n\nYou can  validate the presence of the ``Install-Module`` command by running: ``Get-Command -Module PowerShellGet -Name Install-Module``.\nIf the ``PowerShellGet`` module or the ``Install-Module`` commands are not accessible, you may not be running a supported version of PowerShell. \nMake sure that you are running PowerShell 5.0 or later on a Windows 10 client operating system.\n\n## Usage\n\nAfter installing the ``Image2Docker`` PowerShell module, you will need one or more valid ``.vhdx`` or ``.wim`` files (the \"source image\").\nTo perform a scan of a valid VHDX or WIM image file, simply call the ``ConvertTo-Dockerfile`` command and specify the ``-ImagePath`` parameter, passing in the fully-qualified filesystem path to the source image.\n\n```PowerShell\n  # Perform scan of Windows source image\n  ConvertTo-Dockerfile -ImagePath c:\\docker\\myimage.wim\n```\n\nTo improve performance of the image scan, you may also specify the artifacts that will be discovered within the image.\nThis avoids the performance hit by preventing scanning for artifacts that are intentionally excluded from the scanning process.\nTo discover a list of supported artifacts, use the ``Get-WindowsArtifact`` command. This command will emit an array of supported artifacts.\nOnce you have identified one or more artifacts that you would like to scan for, simply add the ``Artifact`` parameter.\n\nExample:  \n\n```PowerShell\n  # List out supported artifacts\n  Get-WindowsArtifact\n\n  # Perform scan and Dockerfile generation\n  ConvertTo-Dockerfile -ImagePath c:\\docker\\myimage.vhdx -Artifact IIS, Apache\n\n  # Extract a single wesbite from an IIS virtual machine\n  ConvertTo-Dockerfile -ImagePath c:\\vms\\iis.vhd -Artifact IIS -ArtifactParam aspnet-webapi\n```\n\nTo generate Dockerfile from a VHD, build a Docker image and run a container:\n\n```PowerShell\n  ConvertTo-Dockerfile -ImagePath c:\\vms\\iis.vhd -Artifact IIS -ArtifactParam aspnet-webapi -OutputPath c:\\i2d2\n  cd c:\\i2d2\n  docker build -t aspnet-webapi .\n  docker run -d -p 80:80 aspnet-webapi\n```\n\n## Artifacts\n\nThis project supports discovery of custom artifacts.\nEach artifact is represented by a folder that is contained within the ``.\\Functions\\Private\\Artifacts`` subdirectory, containing at least two PowerShell script files that contain :\n\n- ``Discover_\u003cartifact\u003e.ps1`` - This script should contain a function by the same name as the filename which will perform the discovery of the desired artifact and create a resulting manifest file. The function *must* accept the following input parameters: ``[string] $MountPath`` and ``[string] $OutputPath``. The script should write an arbitrary JSON \"manifest\" to the ``$OutputPath``.\n- ``Generate_\u003cartifact\u003e.ps1`` - This script should contain a function by the same name as the filename which will generate the Dockerfile contents for the artifact. This should be the only output emitted from the command. Any output that is emitted from this command will be appended to the ``Dockerfile``. This function *must* support the input parameter: ``[string] $ManifestPath``. The script should read a JSON \"manifest\" contained within the ``$ManifestPath``.\n\nIt is also recommended that you also include within the Artifact directory a test script that validates the output from both the Discover and Generate functions for the artifact.\n\nYou can also include any files within the Artifact directory that may be used to aid in discovering, generating or validating the output for the Artifact.\n\nYou can add your own discovery artifacts to this project, by issuing a pull request. If you don't wish to share the artifacts publicly, you can simply place them into the module's ``.\\Functions\\Private\\Artifacts`` directory on each system that will perform image scans.\n\n## Supported Artifacts\n\nThis project currently supports discovery of the following artifacts:\n\n- Microsoft Windows Server Roles and Features\n- Microsoft Windows Add/Remove Programs (ARP)\n- Microsoft Windows Server Domain Name Server (DNS)\n- Microsoft Windows Internet Information Services (IIS)\n  - HTTP Handlers in IIS configuration\n  - IIS Websites and filesystem paths\n  - ASP.NET web applications\n- Microsoft SQL Server instances\n- Apache Web Server\n\n\n### Known Issues\n\n1. Dism Error: 0x8000000a \n------------------------------------\n\nYou might sometimes receive an error from dism, similar to the following:\n\n  Get-WindowsOptionalFeature : DismOpenSession failed. Error code = 0x8000000a\n\n\nTo work around this problem, specify the artifacts that you wish to discover, using the ``-Artifact`` parameter\non the ``ConvertTo-Dockerfile`` command.\n","funding_links":[],"categories":["Frameworks, Libraries and Tools","框架, 库和工具","Build Automation"],"sub_categories":["Build Automation","自动部署"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fcommunitytools-image2docker-win","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocker%2Fcommunitytools-image2docker-win","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fcommunitytools-image2docker-win/lists"}