ansible-nas
ansible-nas copied to clipboard
Add LazyDocker
Add https://github.com/jesseduffield/lazydocker
I've got this mostly done but making a tty program in a Docker work via a browser is a little beyond me. I pretty much copied and pasted from the Glances task but have no clue how the ports should be assigned or how to make it actually work. I just decremented the Glances ports by one and hoped it would work automagikly. It didn't. Help anyone?
- name: lazydocker Docker Container
docker_container:
name: lazydocker
image: lazyteam/lazydocker
pull: true
ports:
- "61206:61206"
- "61207:61207"
volumes:
- "{{ lazydocker_data_directory }}:/.config/jesseduffield/lazydocker:rw"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/etc/timezone:/etc/timezone:ro"
tty: true
restart_policy: unless-stopped
labels:
traefik.backend: "lazydocker"
traefik.frontend.rule: "Host:lazydocker.{{ ansible_nas_domain }}"
traefik.enable: "{{ lazydocker_available_externally }}"
traefik.port: "61206"
It is probably better to add this to the main host rather than as a docker container, using shell+curl or exec to run https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh. As it is a tty app it doesn't currently have a web interface and would need to be wrapped in something to work through a browser.
If running as a docker, we'd need an alias or longer command to run it from an ssh shell:
echo "alias lzd='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /yourpath/config:/.config/jesseduffield/lazydocker lazyteam/lazydocker'" >> ~/.zshrc
(totally untested and takeb from the github install instructions). It appears that you run the docker when you want to use lazydocker, not permanently.