Skip to content

Remove dependency on lxc-attach #4

Description

@jsdir

agent.autoload

def autoload(instance_id, app_path):
    # Check for user-defined autoload.sh
    # TODO: In a newer release, docker will have functionality to run
    #       a command inside a running container. This will remove
    #       dependency of lxc-attach.
    container = Container(instance_id)
    autoload_file = '/usr/share/stretch/autoload.sh'
    code = call(['lxc-attach', '-n', container.id, '--', '/bin/bash',
                 autoload_file])
    if code == 3:
        # No user-defined autoload.sh, restart container
        container.restart()

Docker provides this functionality in a future release. Switch when stable.

Activity

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions