From @LeighF51 on June 5, 2018 15:59
Hi,
I have a template with 3 projects (one of them being a docker project) that are setup in a template. When creating a new solution from the template the docker file in my service project is included but it is stored away in a set of folders rather than being left at the root of the project it should be part of.
I've tried including a copyOnly section in my template.json but it doesn't seem to work with the DockerFile.
{
"author": "Author",
"classifications": [],
"description": "Service Package Template, generates a set of projects that can be bundled up into a nuget package for service usage",
"name": "Service Template (.NET Core)",
"defaultName": "Test",
"identity": "Sample.Template.CSharp",
"groupIdentity": "Sample.Template",
"tags": {
"language": "C#",
"type": "project"
},
"shortName": "NetCoreServiceTemplate",
"sourceName": "NetCoreServiceTemplate",
"guids": [
"{05DCBF2B-411C-45E0-B5F2-7E8E3120670F}",
"{73E50470-2CD5-4CD0-89CB-E54FA997F56B}"
],
"primaryOutputs": [
{
"path": "TestServiceTemplate\\TestServiceTemplate.csproj"
},
{
"path": "TestServiceTemplateLibrary\\TestServiceTemplateLibrary.csproj"
}
],
"sources": [
{
"include":[
"**/*"
],
"exclude": [
"**/[Tt]estServiceTemplateVsix/**",
"**/*.sln",
"**/.template.config/**"
],
"copyOnly": [
"**/DockerFile"
]
}
]
}

As the image above shows the window on the left displays the path where the file gets stored when creating a solution using the template and the one on the right shows the root of the project where the dockerfile should be based on the location it was at in the template.
I'm not sure if the issue with the dockerfile being stored elsewhere is due to it not having an extension?
Is there a way of me controlling where this file gets stored to in the projects generated from a template?
Copied from original issue: dotnet/templating#1551
From @LeighF51 on June 5, 2018 15:59
Hi,
I have a template with 3 projects (one of them being a docker project) that are setup in a template. When creating a new solution from the template the docker file in my service project is included but it is stored away in a set of folders rather than being left at the root of the project it should be part of.
I've tried including a copyOnly section in my template.json but it doesn't seem to work with the DockerFile.
As the image above shows the window on the left displays the path where the file gets stored when creating a solution using the template and the one on the right shows the root of the project where the dockerfile should be based on the location it was at in the template.
I'm not sure if the issue with the dockerfile being stored elsewhere is due to it not having an extension?
Is there a way of me controlling where this file gets stored to in the projects generated from a template?
Copied from original issue: dotnet/templating#1551