无法通过撰写运行Docker容器

时间:2018-12-16 07:03:42

标签: docker docker-compose asp.net-core-2.1

由于此错误,我无法在 var cultureInfo = new CultureInfo("ar-SA"); cultureInfo.DateTimeFormat.Calendar = new GregorianCalendar(); var requestCulture = new RequestCulture(cultureInfo); Thread.CurrentThread.CurrentCulture = requestCulture; Thread.CurrentThread.CurrentUICulture = requestCulture; 中运行 @SuppressLint("PrivateApi") public IMyAudioService getService(Context mContext) { IMyAudioService mService = null; Method method = null; try { method = Class.forName("android.os.ServiceManager").getMethod("getService", String.class); IBinder binder = (IBinder) method.invoke(null, "YOUR_METHOD_NAME"); if (binder != null) { mService = IMyAudioService .Stub.asInterface(binder); } } catch (NoSuchMethodException | ClassNotFoundException | IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } return mService; } 应用程序,而我可以从Net Core启动容器。

docker-compose

我的dockerfile直接使用Did you mean to run dotnet SDK commands? Please install dotnet SDK from: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 (我直接使用dockerfile目录),所以不需要.dllpublish

build

我跑步:
restore,它可以工作。
但是当我从FROM microsoft/dotnet:aspnetcore WORKDIR /app COPY ./publish . ENTRYPOINT ["dotnet", "Server.dll"] EXPOSE 8202 运行它时:

docker build -t mp . 
docker run --name mp0 -d myimg

我尝试使用:compose mp: image: mp container_name: mp0 build: ./mpbuild ports: - 8302:8202 aspnetcore无济于事,我不断被问到aspnetcore-build的问题。

PS:该应用的版本为aspnetcore-runtime

1 个答案:

答案 0 :(得分:1)

尝试将microsoft/dotnet:aspnetcore更改为microsoft/dotnet:2.2-sdk