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

vNext MVC image gets killed/stopped after 3-4 seconds of working #547

Closed
wisien92 opened this issue May 4, 2015 · 9 comments
Closed

vNext MVC image gets killed/stopped after 3-4 seconds of working #547

wisien92 opened this issue May 4, 2015 · 9 comments

Comments

@wisien92
Copy link

wisien92 commented May 4, 2015

Hi,

I have successfully installed docker on Linux VM and started sample from git.

Now I want to run my procject. So I created image (which was built successfully) using command:

docker build -t versaweb .

And when I start it with command:

docker run -t -d -p 80:5004 versaweb

and when cheking using docker ps it is running but when 3 or 4 second of up time passes i check again with docker ps and it's gone. When I run project on windows machine it works flawlessly - so i belive i have something wron in project.json or in docker.

Here is my project.json:

{
"version": "1.0.0-*",
"bundleExclude": "*.cmd",
"webroot": "wwwroot",
"dependencies": {
    "EntityFramework.SqlServer": "7.0.0-beta3",
    "EntityFramework.InMemory": "7.0.0-beta3", // For Mono.
    "Kestrel": "1.0.0-beta3",
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta3",
    "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta3",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta3",
    "Microsoft.AspNet.Mvc": "6.0.0-beta3",
    "Microsoft.AspNet.Security.OpenIdConnect": "1.0.0-beta3",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta3",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta3",
    "Microsoft.AspNet.SignalR.Server": "3.0.0-beta3",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta3",
    "Microsoft.AspNet.Session": "1.0.0-beta3",
    "Microsoft.Framework.Cache.Memory": "1.0.0-beta3",
    "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta3",
    "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta3",
    "Microsoft.Framework.Logging.Console": "1.0.0-beta3"
},
"commands": {
    "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",
    "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004"

},
"frameworks": {
    "aspnet50": {
        "dependencies": {
            "Utilities": "1.0.0-*"
        }
    }
}
}

Utilities is a ASP.Net 5 Class Library.
And here is my Dockerfile :

FROM microsoft/aspnet
COPY . /app
WORKDIR /app
RUN ["kpm", "restore"]

EXPOSE 5004
ENTRYPOINT ["k", "kestrel"]

I have heared that with linux docker it is possible that it only accept aspnetcore50 freamework - if that's the case is there a way to use SSL streams and Timers? If someone who has experience with this could help me I would really appreciate this :)

@wisien92
Copy link
Author

wisien92 commented May 4, 2015

I noticed that running docker with:

docker run -i -p 80:5004 versaweb

gives me errors (saying that classes from my class library doesn't exist) - what are the differences between those 2 calls?

@tlk
Copy link
Contributor

tlk commented May 4, 2015

@wisien92 those command arguments are described here: https://docs.docker.com/reference/commandline/cli/#run

@wisien92
Copy link
Author

wisien92 commented May 4, 2015

ok so by running without -d I can see why the image is closed -> the reason is my class library, now I wander how do I properly add the library to project ?

@wisien92
Copy link
Author

wisien92 commented May 4, 2015

I have removed ClassLibrary from project and it started. Can anyone tell me why is that?

@muratg
Copy link
Contributor

muratg commented May 4, 2015

/cc: @ahmetalpbalkan

@ahmetb
Copy link

ahmetb commented May 4, 2015

@muratg not a Docker issue. This is known for a very long time.

aspnet/Hosting#59
aspnet/Hosting#140
aspnet/Hosting#129
aspnet/KestrelHttpServer#56

@wisien92 to unblock yourself try making your entrypoint:

ENTRYPOINT sleep 99999999999 | k kestrel

@muratg
Copy link
Contributor

muratg commented May 4, 2015

Oh, this issue. /cc: @victorhurdugaci

@victorhurdugaci
Copy link
Contributor

I have a PR that will allow you to configure how the server stops. aspnet/Hosting#253

@victorhurdugaci
Copy link
Contributor

This should be fixed as part of aspnet/Hosting#140

@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants