Open mlorbetske opened 6 years ago
From @seancpeters on June 5, 2018 23:54
Could you post some info on the directory structure of your template source, including:
The existence or lack of a file extension shouldn't affect the output location of any files.
From @LeighF51 on June 6, 2018 7:16
@seancpeters
In the source the dockerfile can be found at the root of the service template project i.e. C:\Users\fyfieldl\source\Templates\ServiceTemplate\NetCore\NetCoreServiceTemplate - from here I have the dockerfile, csproj etc
This structure for the docker file can also be seen in the template in the solution view
The template.json file is stored one directory up from the service template itself (as it's a multi project template) inside the .template.config folder
Hope this is enough info
From @seancpeters on June 8, 2018 21:26
@LeighF51 - I'm going to need to play with a copy of your template to figure out what's going on. Is the template source in a repo where I can download it?
Also, are you invoking this template only from VS, or also using "dotnet new"?
From @LeighF51 on June 11, 2018 9:50
@seancpeters
You can find a version of the template at https://github.com/LeighF51/ServiceTemplate
Only invoking the template from VS, not using dotnet new at all
Taking a look at the nupkg generated when building the solution in the repo, it looks like the docker file is being placed at a different location than expected.
To get the behavior you expect, the file would need to be located at Content\NetCoreServiceTemplate\Dockerfile
But it's actually located here instead Content\NetCoreServiceTemplate\Dockerfile\NetCoreServiceTemplate\Dockerfile
It looks like this is being done as part of the SideWaffle build process (nothing's jumping out as being a customization that'd have this effect), I'll move this issue to that repo.
I'm encountering this same problem. Seems to be because Dockerfile
has no file extension. If I rename it to Dockerfile.txt
then the problem goes away. What is the resolution/workaround for this?
my Dockerfile doesn't copy to template workaround 1)rename Dockerfile -> Dockerfile.d 2)add the parameter
"RenameDocker": {
"type": "parameter",
"datatype": "text",
"fileRename": "Dockerfile.d",
"defaultValue": "Dockerfile"
}
3)hide the parameter in dotnetcli.host.json or ide.host.json
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