我有一個非常簡單的dockerfile,以「室射頻」安裝後刪除安裝文件,但我得到了一些錯誤,如:Dockerfile「室射頻」失敗
Step 4/4 : RUN rm -Rf /INSTALLATION ---> Running in 19fe828f3c9d rm: cannot remove '/INSTALLATION/Subsystems/Common': Directory not empty rm: cannot remove '/INSTALLATION/Subsystems/EMS': Directory not empty
我用root用戶運行所有。
我dockerfile:
FROM centos COPY INSTALLATION/ /INSTALLATION/ RUN rm -Rf /INSTALLATION
我的操作系統是centos7和主機操作系統是RHLE 7
泊塢窗信息
[[email protected] 1]# docker info Containers: 53 Running: 27 Paused: 0 Stopped: 26 Images: 19 Server Version: 1.13.0 Storage Driver: overlay Backing Filesystem: xfs Supports d_type: false Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e init version: 949e6fa Security Options: seccomp Profile: default Kernel Version: 3.10.0-229.el7.x86_64 Operating System: Red Hat Enterprise Linux Server 7.1 (Maipo) OSType: linux Architecture: x86_64 CPUs: 24 Total Memory: 94.41 GiB Name: snap460c03 ID: T3ST:6DXJ:SDST:3W3J:Z4NB:UXF7:HGSZ:A3WH:ELHX:GVZW:APTD:7ZEK Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Http Proxy: http://16.85.88.10:8080/ No Proxy: docker-registry Registry: https://index.docker.io/v1/ Experimental: false Insecure Registries: docker-registry:5000 127.0.0.0/8 Live Restore Enabled: false
我也嘗試新的容器和手動嘗試,但結果也是錯誤的:
[[email protected] 1]# docker run -it e20c9c5ffa8a /bin/bash [[email protected] /]# rm -Rf /INSTALLATION/Subsystems/Common/* [[email protected] /]# rm -Rf /INSTALLATION/Subsystems/Common rm: cannot remove '/INSTALLATION/Subsystems/Common': Directory not empty
您可以看到第二個rm失敗,我試過rmdir,結果也是錯誤的。
雖然我LS的目錄,它表明:
ls /INSTALLATION/Subsystems/Common ls: cannot access /INSTALLATION/Subsystems/Common/eium-license.config: No such file or directory ls: cannot access /INSTALLATION/Subsystems/Common/install_jdk.sh: No such file or directory eium-license.config install_jdk.sh
你可以把它說沒有這樣的文件,但遵循的文件。
你是否檢查過這些目錄中剩下的文件? – Henry
與rm -r相反,「rm -R」做什麼? – Thilo
@Thilo'-r,-R,--recursive'是同義詞,它們都是一樣的。 – Henry