Runing roscore when executing a docker container

Hello,

I want to execute “roscore” when executing a container.

Right now from my terminal I write:
docker exec -it Asier bash

And then I write:
roscore

Is there a way to do it with just a command?
Such as docker exec Asier roscore

I am trying to do an sh script which does this with other commands.

Thank you in advance :smiley:

The same waqy you run bash as a command, you can just run roscore.