Cloud-config run commands on startup

Is there a file that will execute before user-docker?
I’ve seen examples like this

#cloud-config
write_files:
  - path: /opt/rancher/bin/start.sh
    permissions: "0755"
    owner: root
    content: |
      #!/bin/bash
      echo "I'm doing things on start" > /opt/start-sh-did-this

But there is no /opt/rancher/bin/ folder. So is this outdated information? What place have this file moved to?

/opt/bin/rancher will be created when your particular cloud config file is executed.

Currently all custom commands are run at the same time, which is at the start of the console container. User Docker is started around the same time as the console, so I wouldn’t count on scripts happening either before or after it.

In the future our aim is to implement the cloud config runcmd and bootcmd fields. runcmd will be executed at the same time as commands are now, and bootcmd will happen sometime earlier in the boot process.

It works with /etc/rc.local

  - path: /etc/rc.local
    permissions: "0755"
    owner: root
    content: |
      #!/bin/bash
      crond
```