lazydocker icon indicating copy to clipboard operation
lazydocker copied to clipboard

Custom command params substitution

Open joihn opened this issue 2 years ago • 5 comments

thanks for this tool. small issue:

Describe the bug on latest master (as of 12may), custom command parameter subsitution is not working. The bug does not appear on latest relase.

To Reproduce

  1. build from master as of 12 may
  2. use this example custom command
customCommands:
  containers:
    - name: bash
      attach: true
      command: 'docker exec -it {{ .Container.ID }} bash'
      serviceNames: []
  1. try to launch the custom command Container.ID does not get correctly subsituted. it stay as it when sent to bash

ENV: ubuntu 20.04, x86

joihn avatar May 12 '23 11:05 joihn

I think it's the same what I stumbled upon, seems to be introduced by #387 .

mark2185 avatar May 12 '23 11:05 mark2185

And now I think it get into the latest release 0.21.0.

I have this custom command trying to update a service's image by doing docker compose pull && docker compose up.

customCommands:
  services:
    - name: update-service
      attach: true
      command: '{{ .DockerCompose }} pull {{ .Service.Name }} && {{ .DockerCompose }} up {{ .Service.Name }}'

Run it and I get this

CleanShot 2023-07-21 at 14 46 20@2x

ngocphamm avatar Jul 21 '23 18:07 ngocphamm

For anyone wondering how to downgrade back to 0.20.0 via homebrew - you can use the following snippet:

wget https://raw.githubusercontent.com/jesseduffield/homebrew-lazydocker/b6d29bcd59058d1b7ec371df12f75d7048b40789/lazydocker.rb
brew uninstall lazydocker
brew install -s lazydocker.rb
rm ./lazydocker.rb

VaultVulp avatar Aug 03 '23 10:08 VaultVulp

This should now be fixed in https://github.com/jesseduffield/lazydocker/releases/tag/v0.21.1 (waiting on homebrew to merge it). Sorry it took so long! Thanks to @mark2185 for the fix

jesseduffield avatar Aug 03 '23 10:08 jesseduffield

I believe it has been merged into homebrew so this issue can be closed.

mark2185 avatar Oct 19 '23 05:10 mark2185