欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 房产 > 建筑 > How to debug a appliction on local Linux or WSL?

How to debug a appliction on local Linux or WSL?

2024/10/25 19:38:08 来源:https://blog.csdn.net/wish366/article/details/141175822  浏览:    关键词:How to debug a appliction on local Linux or WSL?

由于K8S权限控制,当部署在上面的应用程式出现问题后,无法还原用户出问题的场景。所以需要把程式部署到本地的Linux或WSL。

1.Upload application publish files to your Linux or WSL.

2.Add a Dockerfile

FROM harbor.xxx.com/dotnet/aspnet:6.0
MAINTAINER XXX
ENV ASPNETCORE_ENVIRONMENT=Development
ENV TZ=Asia/Shanghai
ENV LANG=en_US.UTF-8WORKDIR /app#RUN dotnet restore
#RUN dotnet publish -c Release -o out -r linux-x64COPY ./publish .
ENV ASPNETCORE_URLS http://0.0.0.0:80
ENTRYPOINT ["dotnet", "XXX.dll"]

3.Docker build

docker build --no-cache -t {docker image REPOSITORY:TAG} .
For example: docker build --no-cache -t rubin-demo/faceimage-viewer:1.0 .

4.Start a container

# Doesn't save a container
docker run -it --rm --name {container name} -p {expose port:app port} {container image REPOSITORY:TAG} 
For example: docker run -it --rm --name faceimage-viewer -p 801:80 rubin-demo/faceimage-viewer:1.0 # Save a container
docker run --name {container name} -p {expose port:app port} {container image REPOSITORY:TAG} 
For example: docker run --name faceimage-viewer -p 801:80 rubin-demo/faceimage-viewer:1.0

5.Go to container to debug your APP

docker exec -it {container name} /bin/bash
For example: docker exec -it faceimage-viewer /bin/bashdocker exec -it {container name} /bin/sh
For example: docker exec -it faceimage-viewer /bin/sh

 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com