收藏
回答

服务商微管家与业务系统对接后部署错误怎么解决?

参考的是这篇文章https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/product/wxcloudrun_dev.html

下载的是官方demo

修改dockefile

# 指定wxcomponent镜像
FROM ccr.ccs.tencentyun.com/weixincloud/weixincloud_wxcomponent:latest as wxcomponent


# dotnet镜像
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build
# 选用国内镜像源以提高下载速度
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories
WORKDIR /source


# 恢复项目的依赖项
COPY *.sln .
COPY aspnetapp/*.csproj ./aspnetapp/
RUN dotnet restore -r linux-musl-x64 /p:PublishReadyToRun=true


# copy everything else and build app
COPY aspnetapp/. ./aspnetapp/
WORKDIR /source/aspnetapp
RUN dotnet publish -c release -o /app -r linux-musl-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true /p:PublishSingleFile=true


# final stage/image
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-alpine-amd64


# 容器默认时区为UTC,如需使用上海时间请启用以下时区设置命令
# RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone


# 使用 HTTPS 协议访问容器云调用证书安装
RUN apk add ca-certificates


COPY --from=wxcomponent /wxcloudrun-wxcomponent /wxcloudrun-wxcomponent
ENV GIN_MODE release




# 设定当前的工作目录
WORKDIR /app
COPY --from=build /app ./


# See: https://github.com/dotnet/announcements/issues/20
# Uncomment to enable globalization APIs (or delete)
# ENV \
#     DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
#     LC_ALL=en_US.UTF-8 \
#     LANG=en_US.UTF-8
#RUN apk add --no-cache icu-libs
#ENV ASPNETCORE_URLS=http://127.0.0.1:8090
#ENTRYPOINT ["dotnet", "aspnetapp.dll", "--server.urls", "http://*:8090"]
#ENTRYPOINT ["dotnet", "aspnetapp.dll"]

CMD ["/bin/bash","-ce","./start.sh"]

start.sh

./aspnetapp &
cd /wxcloudrun-wxcomponent
./main


结果报错

----------服务wxcomponent-66438部署wxcomponent-66438-037-----------
2022-09-25 08:43:28 check_eks_virtual_service : process, Back-off restarting failed container, 
2022-09-25 08:43:28 create_eks_virtual_service : succ, 

 通知中心
数据加载失败: 加载 “tcbDescribeCloudBaseRunProcessLog” 失败:Error: InternalError, tars_invoke_err:request timeout|CloudApp.CloudBaseRunServer.MainObj|4953344 (a3b7eb2e-ae27-440b-832b-204c507d8f88), 9 分钟前

回答关注问题邀请回答
收藏

1 个回答

  • 产品-nana
    产品-nana
    2022-09-26

    你好,麻烦提供下APPID,环境ID,我们这边看下

    2022-09-26
    有用
    回复 2
    • Tony
      Tony
      2022-09-26
      wxbb351fd8902f163e    wxcomponent-4gtm5gr8f0f94ec7
      2022-09-26
      回复
    • 产品-nana
      产品-nana
      2022-09-27回复Tony
      你dockerfile命令里面使用了/bin/bash 命令,镜像里面没有安装bash导致创建版本失败了从而导致部署失败
      2022-09-27
      回复
登录 后发表内容
问题标签