Skip to content

make worker to run container with -ti parameter #91

@para1131

Description

@para1131

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions