[英]Where do I place a docker config.json file when docker is installed as a snap on Ubuntu?
我想使用這樣的自定義 docker config.json 文件來重新分配分離擊鍵:
{
"detachKeys": "ctrl-q,ctrl-q"
}
In a "normal" docker world, ie one where docker is installed via apt or similar and not snap, I could put this file in $HOME/.docker/config.json and the setting is picked up when I next run the docker command . 但是,在運行 /snap/bin/docker 時無法識別此文件。 docker 只是默默地忽略它。
如果我試圖強制它使用這個目錄,我會被拒絕:
$ docker --config .docker/ run -it ubuntu /bin/bash
WARNING: Error loading config file: .docker/config.json: open .docker/config.json: permission denied
如果我嘗試在 /var/snap/docker/current/config/ 中找到 daemon.json 旁邊的文件,這也會默默地沒有注意到任何 config.json:
$ ls -l /var/snap/docker/current/config/
total 8
-rw-r--r-- 1 root root 36 Feb 28 11:28 config.json
-rw-r--r-- 1 root root 200 Feb 28 09:44 daemon.json
$ docker run -it ubuntu /bin/bash
現在,我可以強制目錄位置,但肯定有更好的方法嗎?
$ docker --config /var/snap/docker/current/config/ run -it ubuntu /bin/bash
好的,寫完這個問題后,我遇到了答案。 Snap 想要這個文件到 go 這里:
$ ls -l ~/snap/docker/current/.docker/
total 4
-rw-r--r-- 1 gclaybur gclaybur 36 Feb 28 12:04 config.json
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.