Dotnet-docker: alpine images have no cultures installed

Created on 9 May 2018  路  5Comments  路  Source: dotnet/dotnet-docker

Steps to reproduce the issue

  1. Create a new ASP.NET Core 2.1 project
  2. Somewhere in your code, print CultureInfo.GetCultures(CultureTypes.AllCultures)
  3. Run in Docker, using
FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine AS base
WORKDIR /app
EXPOSE 80 5000

FROM microsoft/dotnet:2.1-sdk-alpine AS build
WORKDIR /src
COPY CultureTest/CultureTest.csproj CultureTest/
RUN dotnet restore CultureTest/CultureTest.csproj
COPY . .
WORKDIR /src/CultureTest
RUN dotnet build CultureTest.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish CultureTest.csproj -c Release -o /app

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

Expected behavior

A list of installed cultures

Actual behavior

An empty list

Additional information (e.g. issue happens only occasionally)

Output of docker version

Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:12:48 2018
 OS/Arch:      windows/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Thu Apr 26 07:22:38 2018
  OS/Arch:      linux/amd64
  Experimental: true

Output of docker info

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 37
Server Version: 18.03.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.87-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155db29d0f
ID: 5HYC:PU25:4SOG:EHA5:THHC:IVLC:K2OK:DJUG:O356:MTIX:6WIJ:3EJS
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 48
 Goroutines: 86
 System Time: 2018-05-09T08:39:38.5427872Z
 EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Most helpful comment

All 5 comments

As noted, this is a larger Alpine issue that is not specific to the microsoft/dotnet alpine images. There is nothing we would do to fix this in microsoft/dotnet.

@cypressious - see Build and run the sample for Alpine with Docker for the background on this.

When you try to get a specific culture you also get no exception, instead you just get the invariant culture.

Was this page helpful?
0 / 5 - 0 ratings