docker - Docker 镜像缺少 /tmp?
问题描述
我试图基于这个基于Debian Stretch的图像构建一个图像,并且在运行时不断出现这种错误apt-get update
:
W: GPG error: http://security.debian.org stretch/updates InRelease: Couldn't create temporary file /tmp/apt.conf.FNG6R8 for passing config to apt-key
刚刚添加后已修复
mkdir /tmp && chmod 777 /tmp \
到 Dockerfile RUN
。但接下来的问题是,Docker 镜像是否缺少 tmp 文件?仅基于图像的情况是否如此buildpack-deps:stretch-scm
?有没有比手动创建/tmp
目录更好的方法来处理这个问题?
解决方案
我和你有同样的错误,正如 BMitch 建议的那样,在我的 Dockerfile 中添加这个层为我修复了它。
RUN chmod 1777 /tmp
推荐阅读
- sql - R) 在 R 中使用连接
- javascript - 以 HH:mm:ss 设置当前 GMT 时间
- entity-framework - 使用新的映射规则扩展 EF 6.2
- amazon-s3 - 如何在指定数据类型的同时将数据从 S3 加载到雪花中
- c# - c#中长度前缀二进制流的优雅恢复
- windows - docker.exe - 此应用程序无法启动
- flutter - 使用 TextEditingController 和 StreamBuilder 时文本被清除
- symfony - 配置 api-platform 以在 OpenAPI (AKA Swagger) 文档中包含标头
- c# - C# 从 .txt 文件中读取字符串
- c++ - C++ 堆栈内存使用