I have built an image with simple ASP .NET Core 2.0 App in Alpine Docker. When I run the Linux container on Windows Power-Shell, everything is fine. But if I run the Linux container on a Linux Server in PuTTY, the container will immediately exit with code 139. I have used the following conmmand:
docker run -it -d -p xxxx:80 imageName
output:
510e77c3899696823d4f1fba135cbaff3f8b4232deb1a73d41963fc3a8058d81
run without -d
Hosting environment: Production
Content root path: /app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
OS: Win 10
Docker Version:
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:15:20 2018
OS/Arch: linux/amd64
Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:17:54 2018
OS/Arch: linux/amd64
Experimental: false
Is there a way to keep the container alive? Did I miss anything important? Any ideas would be appreciated!
Update Dockerfile:
#build image
FROM microsoft/dotnet:2.1-sdk as builder
WORKDIR /app
COPY *.csproj .
RUN dotnet restore
COPY . .
RUN dotnet publish --output /out/ --configuration Release
# runtime image
FROM microsoft/dotnet-nightly:2.1-runtime-alpine AS runtime
RUN apk add --no-cache libuv \
&& ln -s /usr/lib/libuv.so.1 /usr/lib/libuv.so
ENV ASPNETCORE_URLS http://+:80
WORKDIR /app
COPY --from=builder /out .
ENTRYPOINT ["dotnet", "WebAppHelloWorld.dll"]
11
/SIGSEGV
which is a segmentation fault. – Riverhead-d
and update your answer with the output. It would also be nice to see your Dockerfile. – Constitutionality