Giter Site home page Giter Site logo

Comments (9)

farshid3003 avatar farshid3003 commented on June 25, 2024 1

Just try to clone the code and run docker build.
It was working but it stop working several days ago as base docker image changed.

from honosoft.dotnet.web.spa.projecttemplates.

farshid3003 avatar farshid3003 commented on June 25, 2024 1

oh sorry I see you change the url yes that should work

from honosoft.dotnet.web.spa.projecttemplates.

Nordes avatar Nordes commented on June 25, 2024

If you run all locally, update dotnet coreon your pc and also clean the bin/obj folders.

from honosoft.dotnet.web.spa.projecttemplates.

farshid3003 avatar farshid3003 commented on June 25, 2024

you need yo use official docker image to solve this problem but it steel not easy. look at the end of this page
https://hackernoon.com/docker-writing-a-smaller-net-core-image-6710f4a1562a
it has a solution for 2.2

from honosoft.dotnet.web.spa.projecttemplates.

Nordes avatar Nordes commented on June 25, 2024

Hi, thank you for raising the issue. I'll try to give a look tonight or over the weekend.

from honosoft.dotnet.web.spa.projecttemplates.

Nordes avatar Nordes commented on June 25, 2024

Hi @farshid3003 , for info, I was already using the proper docker images (officials). They changed their URI recently. That being said, I was able to make it work again by adding the runtime in the build. The final image goes to 300mb :/. I am still looking if it could be possible to have a smaller image in the end.

Here's a functional dockerfile.

####################################################
# To build your own image: 
#    > docker build -t honosoft/vuejs-picnic:latest -t honosoft/vuejs-picnic:1.5.0 .
# To run your image once it's ready:
#    > docker run -d -p 8080:80 --name vuejs-picnic honosoft/vuejs-picnic
# To push the image into your docker repository:
#    > docker push honosoft/vuejs-picnic:latest
# If you wish to remove your dangling images, please do the following (not mandatory)
#    > docker rmi $(docker images -f “dangling=true” -q)
####################################################

# Build the container with Source code compiled
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine3.8 as buildenv
WORKDIR /source
RUN apk add --update nodejs nodejs-npm
COPY *.csproj .
RUN dotnet restore
COPY . .
# Publishing will also restore (install) the npm packages.
RUN dotnet publish -c Release -o /app/ -r linux-musl-x64

# Stage 2 - Creating Image for compiled app
FROM mcr.microsoft.com/dotnet/core/runtime:2.2-alpine3.8 as baseimage
RUN addgroup -S coreApp && adduser -S -G coreApp coreApp
# RUN apk add --update nodejs nodejs-npm

# Define other environment variable if needed.
ENV ASPNETCORE_URLS=http://+:$port

WORKDIR /app
COPY --from=buildenv /app .
RUN chown -R coreApp:coreApp /app

# Replace the application name if required.
ENTRYPOINT ["dotnet", "VueJs.Picnic.CSharp.dll"]
EXPOSE $port

from honosoft.dotnet.web.spa.projecttemplates.

farshid3003 avatar farshid3003 commented on June 25, 2024

yes you right, I think for the fix at least do something that works. don't worry about the image. image is not the container :)
so I think now you need to do something like this :

# Build runtime image
FROM microsoft/dotnet:2.2-aspnetcore-runtime As base
WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.2-sdk AS build-env
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND teletype
RUN apt-get update \
    && apt-get -y upgrade \
    && apt-get -y dist-upgrade \
    && apt-get install -y gnupg \
    && apt-get install -y sudo \
    && curl -sL deb.nodesource.com/setup_10.x | sudo -E bash - \
    && apt-get install -y nodejs

# Copy csproj and restore as distinct layers
WORKDIR /src
COPY *.csproj ./
RUN dotnet restore 

# Copy everything else and build
COPY . .
WORKDIR "/src"
RUN dotnet build -c Release -o /app

# publish
FROM build-env AS publish
RUN dotnet publish -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ProjectName.dll"]

this is working now.

from honosoft.dotnet.web.spa.projecttemplates.

Nordes avatar Nordes commented on June 25, 2024

My example was working (just saying). I tried it locally before posting. I'll try with your proposition later.

from honosoft.dotnet.web.spa.projecttemplates.

farshid3003 avatar farshid3003 commented on June 25, 2024

did you try to run the app after creating docker ?

from honosoft.dotnet.web.spa.projecttemplates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.