Skip to content

[Request]: Add auto-start functionality on boot and container auto-start. #158

Description

@Phfebb

Feature or enhancement request details

Does it not have the auto-start function upon booting up?

(edit: see also related #286 for restart policy for individual containers, the features complement one another so both would be nice to have)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. x8x commented on Jun 30, 2025

    @x8x

    Meanwhile this works:

    1. Create your custom container
    container system start
    container run -d --name nginx nginx
    
    1. Create your 'auto-start' file, ex: ~/Library/LaunchAgents/user.nginx.plist
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    	<dict>
    		<key>Label</key>
    		<string>user.nginx</string>
    		<key>ProgramArguments</key>
    		<array>
    		    <string>/usr/bin/script</string>
    			<string>-q</string>
    			<string>/dev/null</string>
    			<string>/bin/sh</string>
    			<string>-c</string>
    			<string>/usr/local/bin/container system start && sleep 3 && /usr/local/bin/container start nginx</string>
    		</array>
    		<key>RunAtLoad</key>
    		<true />
    		<key>KeepAlive</key>
    		<false />
    		<key>StandardOutPath</key>
    		<string>/tmp/container.log</string>
    		<key>StandardErrorPath</key>
    		<string>/tmp/container.log</string>
    	</dict>
    </plist>
    
    1. Reboot
  2. jglogan commented on Jul 16, 2025

    @jglogan
    Contributor

    This should probably be split into separate issues as they are distinct features:

  3. jglogan commented on Jul 16, 2025

    @jglogan
    Contributor

    @Phfebb OK if I modify the title to just "Add auto-start functionality on boot" since container restart policy is covered by #286?

  4. Phfebb commented on Jul 24, 2025

    @Phfebb
    Author

    OK if I modify the title to just "Add auto-start functionality on boot" since container restart policy is covered by #286?

    ok

  5. goranche commented on Aug 13, 2025

    @goranche

    I liked the temporary "solution" @x8x provided above, but wanted something a bit more flexible, so expanded on it.

    I wrote a script that starts the container system up, and then iterates over containers that have a label named "restart" with the value "boot".
    The plist for launchd can be found here, but needs to be updated with the correct path for your system.

    After that, place the plist file in ~/Library/LaunchAgents and either use launchctl to load and enable it (I can't say I fully understand how, so I just => ) or reboot your system.
    (however, after a reboot, you can run the script using launchctl start com.apple.container.launch 🤷‍♂️ )

    This is of course far from ideal, and meant as @x8x said, "meanwhile ...". This is why I'm not even thinking of merging it upstream, don't think it makes sense 😊

    note: jq is required and must be installed.

    known issues: there are some issues with container itself. if you start a running container it'll stop it and throw an error 🤔 this obviously occurs only if you run the script manually

  6. tcarlson25 commented on Jan 25, 2026

    @tcarlson25

    Any update on this?

  7. saehejkang commented on Feb 7, 2026

    @saehejkang
    Contributor

    This should probably be split into separate issues as they are distinct features:

    I will take a look into all three of these issues, as they seem to be highly requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions