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

make worker to run container with -ti parameter #91

Open
para1131 opened this issue Dec 23, 2019 · 2 comments
Open

make worker to run container with -ti parameter #91

para1131 opened this issue Dec 23, 2019 · 2 comments

Comments

@para1131
Copy link

para1131 commented Dec 23, 2019

Expected/Wanted Behavior

want to make worker to run downloaded image (from manager server) as an interactive and tty enable container (docker run -i -t ). but it wont.

Actual Behavior

Nebula worker run container from downloaded image without -it parameter ("docker run -ti ..."). and restart endlessly. I guess the reason is that my container need console access but as it is not run with -ti parameters therefore it crashes and restart.

Steps to Reproduce the Problem

  1. build my docker image docker buit -t name -f dockerfile.

  2. push it to my local docker registry ip/name

  3. update the nebula mongodb to use my new docker image

  4. on other device i ran
    sudo docker run -i -t -d --restart unless-stopped -v /var/run/docker. sock:/var/run/docker.sock --env DEVICE\_GROUP=example --env REGISTRY\_HOST=https://ip/v1/ --env MAX\_RESTART\ _WAIT\_IN\_SECONDS=0 --env NEBULA\_MANAGER\_AUTH\_USER=nebula --env NEBULA\_MANAGER\_AUTH\_PASSWORD=nebula --env NEBULA\ _MANAGER\_HOST=10.3.1.118 --env NEBULA\_MANAGER\_PORT=83 -- env nebula\_manager\_protocol=http --env NEBULA\_MANAGER\ _CHECK\_IN\_TIME=5 --name nebula-worker nebulaorchestrator/ worker

I checked the running container but ran without -i -t and if i stop the running nebula container in my device and run it with -ti parameter then my container work flawlessly else my container not work and whenever I want to connect to container with docker exec it says the container is restarting(container is in restarting loop).

I tried to find option to add tty and interactive behaviour when creating application in mongodb backend. but I did not find anything relevant.

Additional info:
installed worker on iot device download my image on my iot device from manager server and afterwards worker run it on the device automatically. i checked how my image is run as a container and i saw that it is run without -ti flag in "docker run ...." command. how can I tell/force worker to run the container with -ti option. Docker run -ti.

This is how worker run the container on my device:

docker run --name=example-pgc-1 --hostname=autpc-u104 --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env=JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 --env=JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre --env=WORKDIR=/app --volume=/tmp:/tmp/1 --volume=/var/tmp/:/var/tmp/1:ro --volume=/tmp/1 --volume=/var/tmp/1 --network=host --privileged -p 81:80 --restart=unless-stopped --label container_type="app" --label orchestrator="nebula" --label app_name="example-pgc" 10.3.1.27:5000/pgcmod:latest /bin/sh /usr/local/sbin/run.sh

I want it to be run as below with bolded parameter:
docker run --name=example-pgc-1 --hostname=autpc-u104 --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env=JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 --env=JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre --env=WORKDIR=/app --volume=/tmp:/tmp/1 --volume=/var/tmp/:/var/tmp/1:ro --volume=/tmp/1 --volume=/var/tmp/1 --network=host --privileged -p 81:80 --restart=unless-stopped --label container_type="app" --label orchestrator="nebula" --label app_name="example-pgc" -i -t 10.3.1.27:5000/pgcmod:latest /bin/sh /usr/local/sbin/run.sh

if the container runs without "-i" and particularly without "-t " then the container restart endlessly.

Specifications

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.65. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@naorlivne
Copy link
Member

I'm sorry but I didn't get what the issue is, can you please try to further clear it up for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants