- Más nuevo
- Más votos
- Más comentarios
Run your docker container as a docker component in Greengrass following the instructions in Use interprocess communication in Docker container components.
Then, from the shell on the host where Greengrass is running, find the container name or id via docker ps
and run docker exec -it <container name/id> /bin/sh
Now you can run greengrass_pub --topic "local/topic" --payload "{ \"do_some\" : \"stuff\" } "
Is your command open source? Could you share the repo?
Thank you for that suggestion Massimiliano,
I have followed the instructions to start the docker that runs the program that listens to ipc already and the container can happily listen to IoT-Core topics so i think the permissions are alright. I've also added the accessControl to allow access to local topics.
{
"Run": "docker run --name=abcd --cap-add=SYS_PTRACE --runtime=nvidia -e DISPLAY=$DISPLAY --privileged --volume /tmp/.X11-unix:/tmp/.X11-unix --net=host -e NVIDIA_VISIBLE_DEVICES=all -v $HOME/.Xauthority:/root/.Xauthority -v /run/udev/control:/run/udev/control -v /greengrass/v2:/greengrass/v2 -e SVCUID -e AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT -v /dev:/dev -v /sys/firmware/devicetree/base/serial-number:/sys/firmware/devicetree/base/serial-number -v /data:/data -e NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics xxxxxxxxxx.dkr.ecr.ap-southeast-2.amazonaws.com/smartdvr:dev3 runscript.sh"
}
runscript.sh looks like:
#!/bin/sh
ret=0
while [ $ret -eq 0 ]; do
exec /usr/sbin/my_application_that_listens_to_ipc
ret=$?
sleep 30
done
when i run
docker exec -it abcd /bin/sh
it shows a command prompt ( #
) but as soon as i try to use the command prompt it hangs..
i think that is because it only runs my_application_that_listens_to_ipc .. and i'm not sure that exec can start another 'session' ?
Contenido relevante
- OFICIAL DE AWSActualizada hace 10 meses
- OFICIAL DE AWSActualizada hace un año
I had to change the exec to something else, and then it allowed me to docker exec -it into it. thank you