Skip to content

Commit

Permalink
Dozzle: Use a Docker socket proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
owine committed Feb 5, 2024
1 parent 00545ae commit 501330a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions roles/dozzle/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
# GNU General Public License v3.0 #
##########################################################################
---
################################
# Docker Socket Proxy
################################

dozzle_docker_socket_proxy_envs:
CONTAINERS: "1"

################################
# Basics
################################
Expand Down Expand Up @@ -73,7 +80,9 @@ dozzle_docker_ports: "{{ dozzle_docker_ports_defaults

# Envs
dozzle_docker_envs_default:
DOZZLE_HOSTNAME: "{{ dozzle_web_url }}"
DOZZLE_AUTH_PROVIDER: "{{ 'forward-proxy' if (dozzle_traefik_sso_middleware | length > 0) else omit }}"
DOZZLE_REMOTE_HOST: "dozzle-docker-socket-proxy:2375"
dozzle_docker_envs_custom: {}
dozzle_docker_envs: "{{ dozzle_docker_envs_default
| combine(dozzle_docker_envs_custom) }}"
Expand All @@ -85,8 +94,7 @@ dozzle_docker_commands: "{{ dozzle_docker_commands_default
+ dozzle_docker_commands_custom }}"

# Volumes
dozzle_docker_volumes_default:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
dozzle_docker_volumes_default: []
dozzle_docker_volumes_custom: []
dozzle_docker_volumes: "{{ dozzle_docker_volumes_default
+ dozzle_docker_volumes_custom }}"
Expand Down
7 changes: 7 additions & 0 deletions roles/dozzle/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
dns_zone: "{{ lookup('vars', role_name + '_dns_zone') }}"
dns_proxy: "{{ lookup('vars', role_name + '_dns_proxy') }}"

- name: Create Docker Socket Proxy container
ansible.builtin.include_role:
name: docker_socket_proxy
vars:
docker_socket_proxy_name: "dozzle-docker-socket-proxy"
docker_socket_proxy_docker_envs_custom: "{{ dozzle_docker_socket_proxy_envs }}"

- name: Remove existing Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"

Expand Down

0 comments on commit 501330a

Please sign in to comment.