ansible-nas icon indicating copy to clipboard operation
ansible-nas copied to clipboard

Add LazyDocker

Open davestephens opened this issue 5 years ago • 2 comments

Add https://github.com/jesseduffield/lazydocker

davestephens avatar Aug 26 '19 13:08 davestephens

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"

bcurran3 avatar Jan 05 '20 18:01 bcurran3

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.

animeai avatar Jan 13 '20 10:01 animeai