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

Don't know how to use the docker image #129

Closed
hughjfchen opened this issue Nov 2, 2019 · 3 comments
Closed

Don't know how to use the docker image #129

hughjfchen opened this issue Nov 2, 2019 · 3 comments
Labels

Comments

@hughjfchen
Copy link
Contributor

hughjfchen commented Nov 2, 2019

Currently, the docker image only contain hap and ssh client, not has a even bash. When I feed the docker image with a config file which has run_locally or/and build_script, it always report that it can't find exec. Even with the following minimal config, it also complains exec not found:

deploy_path: '/home/chenjf/hap-sandbox'
# host: myserver.com
# port: 2222
repo: 'https://github.com/shapp-alliance/backend.git'
revision: origin/master
# shell: bash
# ssh_args: 
#build_script:
#  - echo Done
# restart_command: systemd restart my-app-service
vc_action: true
linux: true
release_format: short
keep_releases: 5
linked_files: 
linked_dirs: 
#run_locally: 
#  - /usr/bin/ssh -v

I run the docker image with following command:

docker run -it --rm -v /home/chenjf:/home/chenjf stackbuilders/hapistrano deploy -c /home/chenjf/deploy-config-for-test.yaml

and got following error:

*** localhost ******************************************************************
hap: bash: readCreateProcessWithExitCode: runInteractiveProcess: exec: does not exist (No such file or directory)
@hughjfchen
Copy link
Contributor Author

hughjfchen commented Nov 5, 2019

Well, think more and I believe we should put the hapistrano static executable in a separate directory, e.g. /hapistrano and let the user bind mount the host /bin and /usr/bin to the docker container so that commands on the host machine can be accessed within the docker container. We need to do following:

  • change the Dockerfile to mkdir /hapistrano, and copy the static executable under this directory

  • update the Readme and provide a sample command to tell how to use it

@juanpaucar
Copy link
Contributor

Hi @hughjfchen thanks for your recommendation. We might need to add extra information for the usage with docker. Currently, it has a fixed entry point directly to the hapistrano binary. If you need an interactive shell you could overwrite the entry point; the hapistrano image is based on Alpine.

docker run -it --rm --entrypoint /bin/sh -v $PWD/hap.yaml:/root/hap.yaml stackbuilders/hapistrano

Usually, you shouldn't need to run it interactively and something like this might be enough for most use scenarios,

docker run --rm -v $PWD/hap.yaml:/hap.yaml stackbuilders/hapistrano deploy

Thanks to your report we found about #130, so, for now, to get it working you will also need to add the host as localhost on the configuration file until we ship a new version with this issue fixed

host: localhost

Please, let me know if this comment was of any help or if this doesn't solve your current scenario.

@CristhianMotoche
Copy link
Collaborator

I'll be closing this issue in case the above comment solved it. Feel free to open it's not resolved yet.

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

4 participants