【问题标题】:podman unable to build image from Dockerfile error creating overlay mountpodman 无法从 Dockerfile 构建映像错误创建覆盖挂载
【发布时间】:2022-10-06 10:38:34
【问题描述】:

我收到错误error creating overlay mount to /var/lib/containers/storage/overlay/7a617fad39ce9178c810e29aaef4af73647d8e35ae0969483059441c1c4ee9cd/merged

请在下面找到调试信息。

操作系统

root@cks-master:/vagrant/files# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:        18.04
Codename:       bionic

Dockerfile

# cat ch5Dockerfile 
FROM bash
CMD [\"ping\", \"killer.sh\"]

构建日志

root@cks-master:/vagrant/files# podman build -t simple -f ch5Dockerfile .
STEP 1/2: FROM bash
ERRO[0000] error unmounting /var/lib/containers/storage/overlay/7a617fad39ce9178c810e29aaef4af73647d8e35ae0969483059441c1c4ee9cd/merged: invalid argument 
Error: error mounting new container: error mounting build container \"6c0f88a6da54d713e18283e16521385fff736bc1a1072938fddfc6be4b3d43cc\": error creating overlay mount to /var/lib/containers/storage/overlay/7a617fad39ce9178c810e29aaef4af73647d8e35ae0969483059441c1c4ee9cd/merged, mount_data=\"nodev,metacopy=on,lowerdir=/var/lib/containers/storage/overlay/l/BNREFG6CRAAHJ7VSYG3EUXV5UO:/var/lib/containers/storage/overlay/l/MDSWZVRVZNCOW75JF32K6D4QQC:/var/lib/containers/storage/overlay/l/4G3NS52LYHWPTKA4FURHLYMAPF,upperdir=/var/lib/containers/storage/overlay/7a617fad39ce9178c810e29aaef4af73647d8e35ae0969483059441c1c4ee9cd/diff,workdir=/var/lib/containers/storage/overlay/7a617fad39ce9178c810e29aaef4af73647d8e35ae0969483059441c1c4ee9cd/work\": invalid argument
root@cks-master:/vagrant/files#

播客版

root@cks-master:/vagrant/files# podman version
Version:      3.4.2
API Version:  3.4.2
Go Version:   go1.15.2
Built:        Thu Jan  1 00:00:00 1970
OS/Arch:      linux/amd64
root@cks-master:/vagrant/files# 

    标签: docker build podman


    【解决方案1】:

    问题解决了。

    我还在 https://app.element.io/#/room/#podman:fedoraproject.org 的播客室发布了这个问题

    建议我使用 podman 重置(命令跟踪如下),然后它抱怨 storage.conf,我删除了该文件并再次重置。然后它的工作。

    我仍然想知道 storage.conf 内部是什么导致了这个问题,但我在调查之前删除了它。最后它的工作,我能够继续。希望能帮助到你。

    注意:发布删除 storage.conf 文件和 podman 重置,我也尝试使用 docker build 来检查 docker 是否对 storage.conf 文件有任何依赖,但是没有,docker build 也成功执行(下面的命令跟踪)

    root@cks-master:~# podman system reset -f
    A storage.conf file exists at /etc/containers/storage.conf
    You should remove this file if you did not modified the configuration.
    
    root@cks-master:~# rm /etc/containers/storage.conf
    
    root@cks-master:~# podman system reset -f
    
    root@cks-master:~# podman build -t simple -f /vagrant/files/ch5Dockerfile .
    STEP 1/2: FROM bash
    Resolving "bash" using unqualified-search registries (/etc/containers/registries.conf)
    Trying to pull docker.io/library/bash:latest...
    Getting image source signatures
    Copying blob 9621f1afde84 done  
    Copying blob 1dd831616e40 done  
    Copying blob fd6cd28e0879 done  
    Copying config 8b332999f6 done  
    Writing manifest to image destination
    Storing signatures
    STEP 2/2: CMD ["ping", "killer.sh"]
    COMMIT simple
    --> cd1407a69ea
    Successfully tagged localhost/simple:latest
    cd1407a69ea490496d6635700958f2b5fcf2b1d01f8dd218dea0f83187e55872
    
    root@cks-master:~# podman run --name simple simple
    PING killer.sh (35.227.196.29): 56 data bytes
    64 bytes from 35.227.196.29: seq=0 ttl=42 time=15.689 ms
    64 bytes from 35.227.196.29: seq=1 ttl=42 time=14.662 ms
    64 bytes from 35.227.196.29: seq=2 ttl=42 time=15.161 ms
    ^C
    --- killer.sh ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 14.662/15.170/15.689 ms
    
    
    
    root@cks-master:~# docker build -t simple -f /vagrant/files/ch5Dockerfile .
    Sending build context to Docker daemon  3.141MB
    Step 1/2 : FROM bash
    latest: Pulling from library/bash
    9621f1afde84: Pull complete 
    1dd831616e40: Pull complete 
    fd6cd28e0879: Pull complete 
    Digest: sha256:e4624241e953934fc4c396217253d8322ebda53be3b1863cd7795541d168034f
    Status: Downloaded newer image for bash:latest
     ---> 8b332999f684
    Step 2/2 : CMD ["ping", "killer.sh"]
     ---> Running in 306963a83d1c
    Removing intermediate container 306963a83d1c
     ---> 51dee555fd57
    Successfully built 51dee555fd57
    Successfully tagged simple:latest
    root@cks-master:~# ^C
    root@cks-master:~# 
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-22
      • 1970-01-01
      • 2017-04-16
      • 1970-01-01
      • 1970-01-01
      • 2018-04-06
      • 1970-01-01
      相关资源
      最近更新 更多