首页 > 解决方案 > LXC 上的 Docker - rm 文件:注册层失败:处理 tar 文件时出错(退出状态 1):不允许操作

问题描述

我有一个相当简单的 Dockerfile

FROM python:3.6-slim-stretch

COPY files.zip /tmp
RUN \
    apt-get update && \
    apt-get install -y unzip && \
    apt-get -y autoremove && \
    apt-get clean && \
    mkdir -p /app/data && \
    unzip /tmp/files.zip -d /app/data && \
    rm -f /tmp/files.zip

在本地一切正常(Ubuntu 18.04,Docker 版本 18.09.5,构建 e8ff056)。但是在 LXC 上(对不起,不知道 LXC 的版本,Docker 版本 18.09.4,使用存储驱动程序 overlay2 构建 d14af54)我得到了

failed to register layer: Error processing tar file(exit status 1): 
operation not permitted

当我这样做的时候docker pull myimage:latest。罪魁祸首是线rm -f /tmp/files.zip(没有它,我什至可以在 LXC 上拉出图像)。

我尝试设置各种权限,chmod u+rwx,g+rwx,o+rwx /tmp/files.zip但在 LXC 上,没有该 zip 文件就无法提取图像。

有什么想法吗?

标签: dockerlxc

解决方案


推荐阅读