Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Ask your questions right here!
  3. execute script to start docker container on start up

execute script to start docker container on start up

Scheduled Pinned Locked Moved Ask your questions right here!
4 Posts 2 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • kasarrowtecK Offline
    kasarrowtecK Offline
    kasarrowtec
    Contributor
    wrote on last edited by
    #1

    Hi,

    i am trying to execute a script that will start a docker container every time the VOXL is started.

    A lot of the suggestions for running a script on start up on linux like using crontab or systemd or rc.local is not available with this custom yocto build on the VOXL.

    Does anyone have the best way of doing this ?

    1 Reply Last reply
    0
    • kasarrowtecK Offline
      kasarrowtecK Offline
      kasarrowtec
      Contributor
      wrote on last edited by
      #2

      The most promising way seemed to be to make a service file in etc/systemd/system -

      [Unit]
      Description=Starts the mastervoxl docker container on startup.
      
      [Service]
      Type=simple
      ExecStart=/bin/bash /home/root/mastervoxl_init.sh
      
      [Install]
      WantedBy=multi-user.target
      

      and the script mastervoxl_init.sh being -

      #!/bin/bash
      echo 'initializing mastervoxl docker container'
      docker run -it mastervoxl /bin/bash
      
      1 Reply Last reply
      0
      • Alex KushleyevA Offline
        Alex KushleyevA Offline
        Alex Kushleyev
        ModalAI Team
        wrote on last edited by Alex Kushleyev
        #3

        systemd is available on VOXL, so you could go ahead and try using the service file and script you wrote. Did you try it? However, you need to make sure that the Docker service is running, so your service file should require the Docker service also running. Docker is started by systemd as well.

        1 Reply Last reply
        0
        • kasarrowtecK Offline
          kasarrowtecK Offline
          kasarrowtec
          Contributor
          wrote on last edited by
          #4

          So i managed to get it to work with the following service file and script file -

          [Unit]
          After=docker-autorun.service
          
          [Service]
          Type=simple
          ExecStart=/bin/bash /home/root/mastervoxl_init.sh
          
          [Install]
          WantedBy=multi-user.target
          
          #!/bin/bash
          echo 'initializing mastervoxl docker container'
          docker run --restart=always -i mastervoxl /bin/bash
          
          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          ModalAI
          Categories Recent Tags ModalAI.com Docs
          © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups