Dotnet-docker: microsoft/dotnet:2.1.300-preview2-sdk-alpine

Created on 21 Apr 2018  路  17Comments  路  Source: dotnet/dotnet-docker

Steps to reproduce the issue

  1. pull cheng93/skyrim-tool:dev, this is built on the alpine image
  2. run the image with port 8080 exposed.
  3. Hit the url

Expected behavior

A response

Actual behavior

The container stops.

Extra Info

I have resolved this with cheng93/skyrim-tool:0.1.0 as its built exactly the same but with microsoft/dotnet:2.1.300-preview2-sdk

However it would be great if I could use the alpine image.

Dockerfile

FROM microsoft/dotnet:2.1.300-preview2-sdk-alpine

WORKDIR /app

ADD . /app

EXPOSE 8080

ENV ASPNETCORE_URLS http://*:8080

RUN dotnet build src/Rpg.Server/Rpg.Server.csproj -c Release

CMD [ "dotnet", "run", "--project", "src/Rpg.Server/Rpg.Server.csproj", "-c", "Release", "--no-build" ]

Docker version

Docker version 18.04.0-ce, build 3d479c0af6
area-dockerfiles question

Most helpful comment

microsoft/dotnet-nightly:2.1-sdk-alpine

works on both centos and arch

All 17 comments

@cheng93 - I ran both cheng93/skyrim-tool:0.1.0 and cheng93/skyrim-tool:dev and am able to access the Skyrim Tool web page on each one. What have you tried to diagnose the issue? Have you looked at the container logs or run the container interactively to see what the failure is that causes the container to stop? How are you running the image?

For reference, exposed port is 8080, container name is app

docker run -p 8080:8080 --name app --rm cheng93/skyrim-tool:dev

docker logs -f app

produces

warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
      No XML encryptor configured. Key {08b31153-56ad-467e-80a5-471ab9f593a7} may be persisted to storage in unencrypted form.
Hosting environment: Production
Content root path: /app/src/Rpg.Server
Now listening on: http://[::]:8080
Application started. Press Ctrl+C to shut down.

After I hit localhost:8080, both commands are exited.

When I try investigate the container itself.

docker exec app apk add --no-cache curl
docker exec app curl localhost:8080

I get

curl: (56) Recv failure: Connection reset by peer

I ran your app on Windows, w/o issue. curl works fine, too, both as docker exec (what you did) and from outside (I used Ubuntu on Windows).

I launched your container with: docker run -it --rm -p 8080:8080 cheng93/skyrim-tool:0.1.0

Has to be something on your side. What OS are you using?

dev is the troubling image btw.

On my vm it's CentOS Linux and locally, it's Arch Linux

I will try spinning up a ubuntu vm later and test it against that.

Hmm it's working on windows. Still need to test on ubuntu when I get home.

Right it works on ubuntu, but still not on arch or centos.

I have reproduced this issue on a different project. The Blazor FlightFinder app https://github.com/cheng93/samples/tree/danroth27/flight-finder-0.2.0/samples/aspnetcore/blazor/FlightFinder

  • Arch - Same behaviour
  • Centos - Fails to build the image - Segmentation fault.

I then thought whether I could use dotnet publish (as there there was a bug in preview1)

FROM microsoft/dotnet:2.1.300-preview2-sdk-alpine

WORKDIR /app

#ADD . /app
ADD ./src/Rpg.Server/bin/Release/netcoreapp2.0/publish /app 

EXPOSE 8080

ENV ASPNETCORE_URLS http://*:8080
ENV ASPNETCORE_ENVIRONMENT Development

#RUN dotnet build src/Rpg.Server/Rpg.Server.csproj -c Release

#CMD [ "dotnet", "run", "--project",  "src/Rpg.Server/Rpg.Server.csproj", "-c", "Release", "--no-build" ]
CMD dotnet Rpg.Server.dll

I get a bit more error message than last time

Now listening on: http://[::]:8080
Application started. Press Ctrl+C to shut down.
Segmentation fault (core dumped)

@cheng93 - Have you tried using the most recent 2.1 images from the microsoft/dotnet-nightly repo? You should be able to use microsoft/dotnet-nightly:2.1-sdk and microsoft/dotnet-nightly:2.1-runtime

There doesn't look to be a alpine nightly image for sdk

Oh ignore me, I was looking at the tags section, and I couldn't find it, but when I pulled, it worked

Thats because it appeared 6 minutes after I posted this initially :P

Segmentation fault (core dumped)
On all four of them, this is on arch.

I could try on centos, but I have a feeling it'll be the same

@cheng93 - Can you tell me if SELinux is enabled on your host machines that reproduce this problem?

Centos

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

Arch
Not enabled

I suspect this is related to https://github.com/dotnet/coreclr/issues/17931. Could you disable SELinux to verify on your Centos environment?

I can confirm disabled SELinux on centos works for the alpine image.

@cheng93 - can you try running with the 2.1 images in microsoft/dotnet-nightly? These images contain the latest 2.1.1 fixes. It would be great to get confirmation that your Centos environment with SELinux enabled now works. Would also like to know the results on Arch. Thanks

microsoft/dotnet-nightly:2.1-sdk-alpine

works on both centos and arch

@cheng93 - thanks for validating. I'm going to close this issue. The changes will be rolled out to microsoft/dotnet with the 2.1.1 release.

Was this page helpful?
0 / 5 - 0 ratings