Skip to content
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

Enable docker feature for SPA templates #5417

Open
SteveSandersonMS opened this issue Apr 20, 2018 · 16 comments

Comments

@SteveSandersonMS
Copy link
Member

commented Apr 20, 2018

Currently when you create a new Angular/React project, the Enable Docker support option is disabled because the template config doesn't declare support for that.

We should implement support for this. AFAIK it should be able to work the same way as other ASP.NET templates.

@SteveSandersonMS SteveSandersonMS changed the title Enable docker flag for SPA templates Enable docker feature for SPA templates Apr 20, 2018

@zippy1981

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2018

I've been having a great deal of trouble getting docker to work with the version of the ANgular SPA package that uses angular 4.2.5. I would love for this to just work.

@ZeekoZhu

This comment has been minimized.

Copy link

commented Jul 3, 2018

@zippy1981 I've made some docker images that works well with angular SPA that uses angular@6, hope this can help you: https://hub.docker.com/r/zeekozhu/aspnetcore-build-yarn/tags/

@SteveSandersonMS SteveSandersonMS removed their assignment Jul 25, 2018

@SteveSandersonMS

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2018

Hopefully @ZeekoZhu's suggestion above will give us clues about a good starting point for implementing this.

Having discussed wth @Eilon, it's not yet decided whether this really goes in 2.2 Preview 1 or who would be doing the implementation work on it. So I'm going to unassign myself and hereby ping @mkArtakMSFT for this to be triaged. Also CC @danroth27 @DamianEdwards in case they have a view on the importance or not of this work item.

@danroth27

This comment has been minimized.

Copy link
Member

commented Jul 26, 2018

Also CC @danroth27 @DamianEdwards in case they have a view on the importance or not of this work item.

We chatted about this and agreed this should be done for 2.2.

@mkArtakMSFT

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

Talked to @danroth27 offline regarding this and we're moving this out to a future release as we have not enough resources to handle this in the current milestone.

@ryanbrandenburg

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

Is the work here just to add this line to the spa templates, or is there more to this that I'm just not seeing?

@danroth27

This comment has been minimized.

Copy link
Member

commented Oct 30, 2018

@glennc @lisaguthrie Can you guys provide some guidance on the work needed here?

@ryanbrandenburg

This comment has been minimized.

Copy link
Member

commented Nov 8, 2018

A reminder that I still need some clarification and guidance from @glennc and/or @lisaguthrie.

@lisaguthrie

This comment has been minimized.

Copy link

commented Nov 8, 2018

More work required than just updating the template to support Docker. I ran a quick test creating an Angular project and then adding Docker support post-create (which is possible) and F5 failed. I'm guessing the Dockerfile needs to be updated to be Angular/React-aware and ensure all the right bits end up in the Docker image, but someone would need to look into this further to confirm.

@ryanbrandenburg

This comment has been minimized.

Copy link
Member

commented Nov 9, 2018

I'm guessing the Dockerfile needs to be updated to be Angular/React-aware

Which Dockerfile? As far as I can tell there are no Dockerfiles in the aspnet/Templating repo, even for projects which claim support. Is the work then to create DockerFiles for ALL the templates in this repo? If so @danroth27 and I need to have some discussions about what the goals of this work are, because it's likely much larger than what we thought.

@ryanbrandenburg

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

@glennc it's unclear what the requirements are on this issue.

CC @mkArtakMSFT.

@aspnet-hello aspnet-hello transferred this issue from aspnet/Templating Dec 17, 2018

@aspnet-hello aspnet-hello assigned glennc and unassigned glennc Dec 17, 2018

@aspnet-hello aspnet-hello added this to the 3.0.0-preview1 milestone Dec 17, 2018

@Eilon Eilon modified the milestones: 3.0.0-preview1, 3.0.0-preview2 Dec 18, 2018

@NotMyself

This comment has been minimized.

Copy link

commented Jan 22, 2019

Looks like I ran into this today. Using dotnet new react and attempting to use the following Dockerfile fails with no support for NPM.

FROM microsoft/dotnet:2.2-sdk-alpine AS build
WORKDIR /app

COPY . .
RUN dotnet restore
RUN dotnet build
RUN dotnet publish -c Release -o /app/deploy

FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine AS runtime
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
WORKDIR /app
EXPOSE 80
COPY --from=build /app/deploy ./
ENTRYPOINT ["dotnet", "api.dll"]
@glennc

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

There are a few ways a customer could do something the most likely 2 are:

  1. Use multi-stage build so that actions requiring node happen in their own image, separate to the .NET compilation process. This assumes you don't need node at runtime and mostly need npm restore and trans-pile steps.
  2. Create your own build possibly runtime image that adds the version of node and other tools that you need.

Depending on your build pipeline and lots of other details there might be other options. But those 2 are the pure Docker way of doing it.

For us the only real option is to generate a multi-stage Dockerfile that uses the Node images when node is required. However, the Dockerfile contents are not currently owned by us. They are generated by the Docker tooling team. We could probably add Dockerfiles that you could get on the commandline, and then use right-click to add support later. But getting the VS checkbox for Docker support to work requires more work with a different team.

Either way, we don't currently have time for this in the 3.0 milestone so I am moving the issue out. However, we could do a blog post explaining to everyone how they can get this working today without template support. @danroth27 do you want to work on that with me?

@glennc glennc modified the milestones: 3.0.0-preview3, Backlog Feb 15, 2019

@danroth27

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

However, we could do a blog post explaining to everyone how they can get this working today without template support. @danroth27 do you want to work on that with me?

@glennc Sure

@ricardoasilva92

This comment has been minimized.

Copy link

commented May 16, 2019

However, we could do a blog post explaining to everyone how they can get this working today without template support. @danroth27 do you want to work on that with me?

@glennc Sure

any news on this?

@tiagomelobr

This comment has been minimized.

Copy link

commented Jun 3, 2019

Anyone else found a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.