Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加开启docker远程API #444

Merged
merged 2 commits into from
Jan 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions roles/docker/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ LOG_MAX_FILE: 3

# docker容器存储目录
STORAGE_DIR: "/var/lib/docker"

# 开启Restful API
ENABLE_REMOTE_API: false
5 changes: 5 additions & 0 deletions roles/docker/templates/daemon.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
"max-file": "{{ LOG_MAX_FILE }}"
},
"data-root": "{{ STORAGE_DIR }}"

{% if ENABLE_REMOTE_API %}
, "hosts": ["tcp://0.0.0.0:2376", "unix:///var/run/docker.sock"]
{% endif %}

}