jesseduffield / lazydocker

The lazier way to manage everything docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom command passing a string literal

pythoninthegrass opened this issue · comments

Describe the bug
Running an ad hoc docker run command in the terminal works. Passing the same command to lazydocker as either a scalar (folded/literal) or inline fails.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom command in config.yml
    - name: run-meetup
      attach: true
      command: >
        docker run -it --name meetup_bot
        -p 80:3000
        -e PORT="3000"
        -v "$(pwd)":/home/appuser/app
        --env-file .env
    - name: run-meetup
      attach: true
      command: 'docker run -it --name meetup_bot -p 80:3000 -e PORT="3000" -v "$(pwd)":/home/appuser/app --env-file .env meetup_bot bash'
  2. Open lazydocker
  3. Run the command
  4. Raises error:
    + docker run -it --name meetup_bot -p 80:3000 -e PORT=3000 -v $(pwd):/home/appuser/app --env-file .env meetup_bot bash
    docker: Error response from daemon: create $(pwd): "$(pwd)" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
    See 'docker run --help'.

Expected behaviour
It should interpolate/expand the pwd command or $PWD built-in variable in the command. Only able to hard-code the absolute path to work around the issue. Less than ideal, of course.


Desktop (please complete the following information):

  • OS: macOS 12.4 (21F79)
  • Lazydocker Version: v0.18.1
  • The last commit id if you built project from sources: N/A

Additional context
Using the new docker mount syntax got the same results.

$(pwd) have to run in the shell, but lazydocker seems like run command directly.
I think this is not bug, but run commands through shell will be more convenient I think.

What would you suggest the workflow should be if this isn't a bug @skanehira?

ezoic increase your site revenue