crops / poky-container

A container image that is able to run bitbake/poky. It has helpers to create users and groups within the container. This is so that the output generated in the container will be readable by the user on the host.
GNU General Public License v2.0
214 stars 96 forks source link

Add helper script and integrate with ssh-agent #90

Open amsobr opened 2 years ago

amsobr commented 2 years ago

Added a script, poky-container, which can be used to simplify the listing and launching of the available containers.

Listing available containers

Note: the list of containers is maintained by hand.

 poky-container list
AlmaLinux:
    alma-8 alma-9

CentOS:
    centos-7

Debian:
    debian-9 debian-10 debian-11

Fedora:
    fedora-33 fedora-34 fedora-35 fedora-36

OpenSuse:
    opensuse-15.2 opensuse-15.3 opensuse-15.4

Ubuntu:
    ubuntu-16.04 ubuntu-18.04 ubuntu-20.04 ubuntu-22.04

Launching a container

user@host$ poky-container run ubuntu-20.04
...
pokyuser@4da677d43c61:/workdir$ 

Basic help

user@host$ poky-container help
Usage:
    poky-container list
                List available images

    poky-container run IMAGE [HOST_WORKDIR]
                Run the selected image on a specific location

Parameters:
    IMAGE           The name of the image to run
    HOST_WORKDIR    The working directory, ie, location if the workspace
                    on the host, which will show as /workdir in the
                    container.
                    By default, the current working directory is used.

ssh-agent integration

When launching the container, if SSH_AUTH_SOCK is set, the socket is bind-mounted in the container too and ~/.bashrc in the container recreates the SSH_AUTH_SOCK variable.

Feel free to pick any of the changes or suggest improvements. Thanks.