Hello community,

here is the log from the commit of package toolbox for openSUSE:Factory checked 
in at 2020-11-29 12:20:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/toolbox (Old)
 and      /work/SRC/openSUSE:Factory/.toolbox.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "toolbox"

Sun Nov 29 12:20:39 2020 rev:7 rq:851003 version:1.0+git20201126.3d26283

Changes:
--------
--- /work/SRC/openSUSE:Factory/toolbox/toolbox.changes  2020-09-06 
21:37:51.761702276 +0200
+++ /work/SRC/openSUSE:Factory/.toolbox.new.5913/toolbox.changes        
2020-11-29 12:20:45.961537193 +0100
@@ -1,0 +2,7 @@
+Thu Nov 26 10:48:21 UTC 2020 - [email protected]
+
+- Update to version 1.0+git20201126.3d26283:
+  * Make it easier to use custom images (#10)
+  * Update toolbox doc (#9)
+
+-------------------------------------------------------------------

Old:
----
  microos-toolbox-1.0+git20200831.d2d2e5d.tar.xz

New:
----
  microos-toolbox-1.0+git20201126.3d26283.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ toolbox.spec ++++++
--- /var/tmp/diff_new_pack.iSBpQj/_old  2020-11-29 12:20:46.721537961 +0100
+++ /var/tmp/diff_new_pack.iSBpQj/_new  2020-11-29 12:20:46.725537965 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           toolbox
-Version:        1.0+git20200831.d2d2e5d
+Version:        1.0+git20201126.3d26283
 Release:        0
 Summary:        Script to start a toolbox container for system debugging
 License:        Apache-2.0

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.iSBpQj/_old  2020-11-29 12:20:46.765538006 +0100
+++ /var/tmp/diff_new_pack.iSBpQj/_new  2020-11-29 12:20:46.765538006 +0100
@@ -1,6 +1,6 @@
 <servicedata>
   <service name="tar_scm">
     <param name="url">git://github.com/thkukuk/microos-toolbox.git</param>
-    <param 
name="changesrevision">dc2edc81ba96c84cfde64d3883bfaf85241491c2</param>
+    <param 
name="changesrevision">3d26283d2baa62d1351c3dbe356caf8590d202f0</param>
  </service>
 </servicedata>
\ No newline at end of file

++++++ microos-toolbox-1.0+git20200831.d2d2e5d.tar.xz -> 
microos-toolbox-1.0+git20201126.3d26283.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/microos-toolbox-1.0+git20200831.d2d2e5d/README.md 
new/microos-toolbox-1.0+git20201126.3d26283/README.md
--- old/microos-toolbox-1.0+git20200831.d2d2e5d/README.md       2020-08-31 
10:39:03.000000000 +0200
+++ new/microos-toolbox-1.0+git20201126.3d26283/README.md       2020-11-26 
11:47:36.000000000 +0100
@@ -1,9 +1,34 @@
 # toolbox - bring your own tools with you
 
-On systems using `transactional-update` it is not really possible due to the 
read-only root filesystem to install tools to analyze problems in the currently 
running system, a reboot is always required. Which makes it next to impossible 
to debug such problems.
-`toolbox` is a small script that launches a container to let you bring in your 
favorite debugging or admin tools in such a system. The root filesystem can be 
found at `/media/root`.
+On systems using `transactional-update` it is not really possible - due to the 
read-only root filesystem - to install tools to analyze problems in the 
currently running system as a reboot is always required. This makes it next to 
impossible to debug such problems.
+`toolbox` is a small script that launches a podman container in a rootless or 
rootfull state to let you bring in your favorite debugging or admin tools in 
such a system. You can also install and run GUI applications in your `toolbox` 
container. The root filesystem can be found at `/media/root`.
 
-## Usage
+## Usage     
+     
+The following options are avialbe in `toolbox`:
+* `-h` or `--help`: Shows the help message
+* `-u` or `--user`: Run as the current user inside the container
+* `-R` or `--registry` `<registry>`: Explicitly specify the registry to use
+* `-I` or `--image` `<image>`: Explicitly specify the image to pull
+* `-r` or `--root`: Runs podman via sudo as root
+* `-t` or `--tag` <tag>: Add <tag> to the toolbox name
+    
+You may override the following variables by setting them in ${TOOLBOXRC}:
+* REGISTRY: The registry to pull from. Default value is: 
`registry.opensuse.org`.
+* IMAGE: The image and tag from the registry to pull. Default value is: 
`opensuse/toolbox`.
+* TOOLBOX_NAME: The name to use for the local container. Default value is: 
`"${HOME}"/.toolboxrc`.
+* TOOLBOX_SHELL: Standard shell if no other commands are given. Default value 
is: `/bin/bash`.
+
+Example toolboxrc:
+* `REGISTRY`=my.special.registry.example.com
+* `IMAGE`=debug:latest
+* `TOOLBOX_NAME`=special-debug-container
+* `TOOLBOX_SHELL`=/bin/bash"
+
+If a config file is found, with REGISTRY and IMAGE defined, 
"${REGISTRY}/${IMAGE}" is used, overriding the default.
+If -R and/or -I is/are used they override both the defaults and the content of 
REGISTRY and/or IMAGE from the config file.
+
+### Rootfull Usage Example
 
 ```
 $ /usr/bin/toolbox
@@ -33,9 +58,11 @@
 sh-5.0# vi /media/root/etc/passwd
 ```
 
-### Usage as user
+## Rootless Usage 
 
-In case an proper user environment is what one wants (e.g., for development), 
the `-u` (or `--user`) option can be used:
+In case a proper user environment is what one wants (e.g., for development), 
the `-u` (or `--user`) option can be used:
+
+### Rootless Usage Example
 
 ```
 $ id -a
@@ -158,3 +185,14 @@
 Container started successfully. To exit, type 'exit'.
 sh-5.0#
 ```
+
+## Troubleshooting
+
+#### Podman can't pull/run images with user
+If you want to run a rootless `toolbox` setup you might need to add a range of 
UID and GID for the user you want to run `toolbox` with. Before adding UID and 
GID ranges check if `/etc/subuid` and `/etc/subgid` are actually empty. If 
empty you can run this as root to populate them:   
+```
+echo "podman_user:100000:65536" > /etc/subuid
+echo "podman_user:100000:65536" > /etc/subgid
+```
+#### GUI application can't connect to display 
+This happens if you run the container as root - with sudo for example - while 
you're logged in as user to the desktop environment. The easiest way is to use 
`toolbox -u` with your user to setup a `rootless toolbox`  container for such 
cases. 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/microos-toolbox-1.0+git20200831.d2d2e5d/toolbox 
new/microos-toolbox-1.0+git20201126.3d26283/toolbox
--- old/microos-toolbox-1.0+git20200831.d2d2e5d/toolbox 2020-08-31 
10:39:03.000000000 +0200
+++ new/microos-toolbox-1.0+git20201126.3d26283/toolbox 2020-11-26 
11:47:36.000000000 +0100
@@ -69,16 +69,18 @@
         echo "Setting up user '${USER_NAME}' (with 'sudo' access) inside the 
container..."
         echo "(NOTE that, if 'sudo' and related packages are not present in 
the image already,"
         echo "this may take some time. But this will only happen now that the 
toolbox is being created)"
-        cat <<EOF > /tmp/${TOOLBOX_NAME}-user-setup.sh
+        local tmp_user_setup=`mktemp 
${HOME}/.${TOOLBOX_NAME}-user-setup-XXXXXX.sh`
+        cat <<EOF > ${tmp_user_setup}
 #!/bin/bash
 groupadd -g ${USER_GID} ${USER_GNAME} &> /dev/null
 useradd -M -N -g ${USER_GNAME} -u ${USER_ID} ${USER_NAME} &> /dev/null
-zypper install -y --no-recommends sudo system-group-wheel &> /dev/null
+getent group wheel >/dev/null || zypper install -y --no-recommends sudo 
system-group-wheel &> /dev/null
 echo "%wheel ALL = (root) NOPASSWD:ALL" > /etc/sudoers.d/wheel 2> /dev/null
 usermod -G wheel -a ${USER_NAME} &> /dev/null
 EOF
-        ${SUDO} podman cp /tmp/${TOOLBOX_NAME}-user-setup.sh 
${TOOLBOX_NAME}:/tmp/user-setup.sh
-        ${SUDO} podman exec --user root ${TOOLBOX_NAME} bash /tmp/user-setup.sh
+        ${SUDO} podman cp ${tmp_user_setup} ${TOOLBOX_NAME}:${tmp_user_setup}
+        ${SUDO} podman exec --user root ${TOOLBOX_NAME} bash ${tmp_user_setup}
+        ${SUDO} podman exec --user root ${TOOLBOX_NAME} rm ${tmp_user_setup}
     fi
 
     echo "Container started successfully. To exit, type 'exit'."
@@ -177,7 +179,7 @@
     # Execute setup first so we get proper variables
     setup
     # If we are passed a help switch, show help and exit
-    ARGS=`getopt -o hrut: --long help,root,user,tag: -n toolbox -- "$@"`
+    ARGS=`getopt -o hrut:R:I: --long help,root,user,tag:,registry:,image: -n 
toolbox -- "$@"`
     eval set -- "$ARGS"
     while true; do
         case "$1" in
@@ -206,6 +208,18 @@
                 TOOLBOX_NAME="${TOOLBOX_NAME}-$2"
                 shift 2
                 ;;
+            -R|--registry)
+                REGISTRY=$2
+                # Let's rebuild the image URI (this means that command
+                # line, if present, overrides config file)
+                TOOLBOX_IMAGE="${REGISTRY}"/"${IMAGE}"
+                shift 2
+                ;;
+            -I|--image)
+                IMAGE=$2
+                TOOLBOX_IMAGE="${REGISTRY}"/"${IMAGE}"
+                shift 2
+                ;;
             --)
                 shift
                 break
_______________________________________________
openSUSE Commits mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives: 
https://lists.opensuse.org/archives/list/[email protected]

Reply via email to