【Docker】docker掛在檔案報錯:container_linux.go:247......not a directory__linux

來源:互聯網
上載者:User

執行容器啟動命令:

[root@localhost conf]# docker run --name iwsactivemq -p 61617:61616 -p 8162:8161 -p 1884:1883  -v /home/iws/activmemq/conf/activemq.xml:/opt/activemq/conf/activemq.xml  -v /home/iws/iws-logs/activemq/logs:/data/activemq --restart=always -d iws:activemq3ecdf4cebd230f313358b9f4965b46585a2ca1570da26109c4e34302a2715b7e

報錯:

docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:359: container init caused \\\"rootfs_linux.go:53: mounting \\\\\\\"/home/iws/activmemq/conf/activemq.xml\\\\\\\" to rootfs \\\\\\\"/var/lib/docker/devicemapper/mnt/1bac9274ba8dc64a778098609659f0a6b5a2873848c48a2cff8b301c8c7ff976/rootfs\\\\\\\" at \\\\\\\"/var/lib/docker/devicemapper/mnt/1bac9274ba8dc64a778098609659f0a6b5a2873848c48a2cff8b301c8c7ff976/rootfs/opt/activemq/conf/activemq.xml\\\\\\\" caused \\\\\\\"not a directory\\\\\\\"\\\"\"\n".

解決方案:

1、去掉activemq.xml掛載後啟動

[root@localhost conf]# docker run --name iwsactivemq -p 61617:61616 -p 8162:8161 -p 1884:1883 -v /home/iws/iws-logs/activemq/logs:/data/activemq --restart=always -d iws:activemqce907efb8d4b7b7ce818aa6808ea3e10eb0ab2659021624f060000dfd5f07495

啟動成功

2、將容器內的activemq.xml複製到宿主機掛載目錄

[root@localhost conf]# docker cp ce907efb8d4b:/opt/activemq/conf/activemq.xml ./

3、刪掉第一步的容器

4、重新設定掛載檔案並啟動:

[root@localhost conf]# docker run --name iwsactivemq -p 61617:61616 -p 8162:8161 -p 1884:1883  -v /home/iws/activmemq/conf/activemq.xml:/opt/activemq/conf/activemq.xml  -v /home/iws/iws-logs/activemq/logs:/data/activemq --restart=always -d iws:activemq1be2efcea9bdf460437b3ab798c5f0421550c13182d534227e26122d250b2d08

啟動成功。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.