简体   繁体   English

如何在Arch Linux中启用Docker的“ --squash”功能?

[英]How to enable “--squash” feature of Docker in Arch Linux?

To use --squash feature of Docker , you need to enable the experimental features of the Docker daemon . 要使用Docker --squash功能,您需要启用Docker daemon的实验性功能。 How this can be done on Arch Linux ? Arch Linux上如何做到这一点?

Thanks. 谢谢。

This is how I got it to work in ArchLinux with systemd 这就是我如何使其在带有systemd的ArchLinux中工作

/etc/docker/daemon.json /etc/docker/daemon.json

added the json blob below 在下面添加了json blob

{ 
    "experimental": true 
} 

then restart the service 然后重新启动服务

systemctl restart docker.service

On Arch Linux , you can add --experimental=true to the end of the ExecStart=/usr/bin/dockerd -H fd:// line in the /usr/lib/systemd/system/docker.service file in order to enable the experimental feature. Arch Linux ,您可以在/usr/lib/systemd/system/docker.service文件的ExecStart=/usr/bin/dockerd -H fd://行的末尾添加--experimental=true ,以便启用实验功能。

Then, you need to reload and restart the Docker daemon : 然后,您需要重新加载并重新启动Docker daemon

systemctl daemon-reload
systemctl restart docker.service

With recent docker versions neither of the methods works any more. 在最新的docker版本中,这两种方法都不起作用。 See https://github.com/docker/cli/issues/947 参见https://github.com/docker/cli/issues/947

As a summary, there is docker and docker cli. 作为总结,有docker和docker cli。 Both are not the same. 两者不一样。 Experimental mode must be enabled for docker cli. 必须为docker cli启用实验模式。 Thus one has to edit the file $HOME/.docker/config.json . 因此,必须编辑$HOME/.docker/config.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM