惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
博客园 - 【当耐特】
量子位
Engineering at Meta
Engineering at Meta
博客园_首页
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
V
Visual Studio Blog
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
Jina AI
Jina AI
The Cloudflare Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
博客园 - 聂微东

博客园 - 风海迷沙

arduino esp32连接mqtt坑 android重建手记全是坑 nginx in docker 手记 域名备案手记2022-12-6 sql server to mysql迁移笔记 vben-admin笔记 vs2022无法推送master分支至gitea git报错:[rejected]master->master(non-fast-forward) vs2022中razor页面无法使用js代码片断联想功能 前端 vue3 随手记 .NET5来了 笔记 CentOS7 + asp.net core 3.1 + mysql 8 配置备忘 SQL 管理权限数据库关系图无法打开的问题 android studio 4.0无法创建Activity Android signalR 阿里云虚拟空间.net 网站错误 server 2012 r2 配置 在线流媒体nginx/Windows解决方案 ECS上配置FTP Filezilla 新项目扫雷专贴 备忘录
.net8.0 在docker下发布镜像的坑
风海迷沙 · 2023-12-13 · via 博客园 - 风海迷沙

最近升级.net8.0,出现应该不能在挂载目录中建立文件的问题,在相应位置创建时报错,在docker中

/app/Upload$ >1.txt
bash: 1.txt: Permission denied

 7.0是没有这个问题的,根据官方说法:.NET 8.0 Container Images Now Available · dotnet/dotnet-docker · Discussion #4995 · GitHub

New Features for .NET Container Images

Non-Root User Included By Default

The .NET Linux container images include a new non-root user named app with the UID 1654.
The UID is provided in an environment variable, $APP_UID.
You can opt into this new user by adding the line USER $APP_UID to your Dockerfile.

Important

The name of this user may conflict with an existing user defined by your application's Dockerfile.

简单点的解决方案:docker run 时加上参数 --user 0,把root或想要的用户UID传入