Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker version creates a docker container per query/command #197

Open
lolouk44 opened this issue Feb 26, 2019 · 5 comments
Open

docker version creates a docker container per query/command #197

lolouk44 opened this issue Feb 26, 2019 · 5 comments
Labels

Comments

@lolouk44
Copy link

lolouk44 commented Feb 26, 2019

a few issues when using docker

  1. I actually have to run the command as ./hass-cli when in same folder. Ubuntu 16.04. So your command source <(hass-cli completion zsh) doesn't work. I tried source <(./hass-cli completion zsh) but still can't use autocomplete. I get a lot of errors like:
    image

  2. each time I run the command, a new container gets created and never cleaned. This means I can't add the container to watchtower (for auto-updates) as I don't know its name. If I name the container (with --name hass-cli for example), then I have to manually remove it first before I can call the command again

Thanks though. Really looking forward to having it working, looks great

@maxandersen
Copy link
Contributor

  1. you need to put the hass-cli script into your path. Then it works.

  2. this is a short lived container so not expected to have a consistent name. If you have a better suggestion on how to run the docker command let me know.

@lolouk44
Copy link
Author

lolouk44 commented Mar 1, 2019

Thanks. Added to path, now I can run without the full path.
Still get issues though:
image

I've amended the script to name the container and delete after running:

docker run --name hass-cli -e HASS_TOKEN -e HASS_SERVER -e _HASS_CLI_COMPLETE -e COMP_WORDS -e COMP_CWORD -e _HASS_CLI_COMPLETE $IMAGE $*
docker rm hass-cli > /dev/null

@maxandersen
Copy link
Contributor

Are you 100% sure you have the right content in that downloaded hass-cli ?

".ror: No such command" is not something I can see how this docker image would outpout.

@lolouk44
Copy link
Author

lolouk44 commented Mar 7, 2019

I believe it's correct...
Here is the content:

## Use the tag that best fits you
## dev contains last build from dev branch. 
#TAG=dev
## latest is latest released build
TAG=latest
## You can also use a specific tag, see https://hub.docker.com/r/homeassistant/home-assistant-cli/tags
## for available ones.
##TAG=0.6.0

IMAGE=homeassistant/home-assistant-cli:$TAG

## The -e arguments passes in the environment variables needed for basic hass-cli setup (HASS_SERVER and HASS_TOKEN)
## and whats needed for auto completion (_HASS_CLI_COMPLETE, COMP_WORDS, COMP_CWORD)
## Be aware that while hass-cli runs via docker these variables values will be visible using `docker inspect`.
docker run --name hass-cli -e HASS_TOKEN -e HASS_SERVER -e _HASS_CLI_COMPLETE -e COMP_WORDS -e COMP_CWORD -e _HASS_CLI_COMPLETE $IMAGE $*
docker rm hass-cli > /dev/null

@stale
Copy link

stale bot commented May 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 6, 2019
@maxandersen maxandersen added pinned and removed wontfix labels May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants