Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distrobox assemble create -n vis fails #1301

Closed
mcepl opened this issue Mar 21, 2024 · 2 comments
Closed

distrobox assemble create -n vis fails #1301

mcepl opened this issue Mar 21, 2024 · 2 comments
Labels
bug Something isn't working wait-on-user waiting for a reply

Comments

@mcepl
Copy link
Contributor

mcepl commented Mar 21, 2024

Describe the bug

mitmanek:distrobox $ cat distrobox.ini 
[vis]
image="registry.opensuse.org/home/mcepl/moldavite/containers/opensuse/vis-master:latest"
pull=true
replace=true
mitmanek:distrobox $ distrobox assemble create -v -n vis
\[output attached as [distorbox-assemble-log.txt](https://github.com/89luca89/distrobox/files/14707060/distorbox-assemble-log.txt)\]
mitmanek:distrobox $ distrobox list
ID           | NAME                 | STATUS             | IMAGE                         
c9f84c8e4e2a | weechat              | Created            | registry.opensuse.org/home/mcepl/moldavite/containers/opensuse/weechat:latest
7152aa1829a0 | gomuks               | Created            | registry.opensuse.org/home/mcepl/moldavite/containers/opensuse/gomuks:latest
38da860ce7ea | tumbleweed           | Exited (143) 6 days ago | registry.opensuse.org/opensuse/distrobox:latest
8ac396b26866 | vis                  | Created            | registry.opensuse.org/home/mcepl/moldavite/containers/opensuse/vis-master:latest
3c81e2948205 | fun                  | Exited (143) 7 minutes ago | registry.opensuse.org/home/mcepl/moldavite/containers/opensuse/fun:latest
mitmanek:distrobox $ 

In other window inside of the distrobox with openSUSE/Tumblweed:

tumbleweed-pkg~$ cat ~/.bin/vis
#!/bin/sh
# distrobox_binary
# name: vis
if [ -z "${CONTAINER_ID}" ]; then
	exec /usr/bin/distrobox-enter  -n vis -- 		/usr/bin/vis  "$@"
elif [ -x "/usr/bin/vis" ] ; then
    /usr/bin/vis "$@"
elif [ -x "/usr/bin/distrobox-host-exec" ] ; then
    /usr/bin/distrobox-host-exec ~/.bin/vis "$@"
else
    echo "Cannot run vis"
    exit 255
fi
tumbleweed-pkg~$ vis rpm-qa.txt 
Error: reading information about layer "2c6080646d98f498304302cfcdbaf7000b7d95ab8bd466c72f51c662222f30a9": layer not known
Creating the container vis
Creating 'vis' using image registry.opensuse.org/opensuse/distrobox:latest	Error: creating container storage: the container name "vis" is already in use by 8ac396b2686683de5adcbc2d248e625ae60f3dec4ad096921487813b9026505b. You have to remove that container to be able to reuse that name: that name is already in use, or use --replace to instruct Podman to do so.
 [ ERR ]
Error: unable to start container "8ac396b2686683de5adcbc2d248e625ae60f3dec4ad096921487813b9026505b": mounting storage for container 8ac396b2686683de5adcbc2d248e625ae60f3dec4ad096921487813b9026505b: layer not known
tumbleweed-pkg~$ 

To Reproduce
See above

Expected behavior
editor should start from within the container

Logs
Attach also the output of podman logs or docker logs, possibly with --latest flag
vis-log.txt

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod? podman
  • Which version or podman, docker or lilipod? podman-4.9.3-2.1.x86_64
  • Which version of distrobox? distrobox-1.7.0.1_g7a56b6e-1.1.noarch
  • Which host distribution? openSUSE/Tumbleweed
  • How did you install distrobox? openSUSE packages
@mcepl mcepl added the bug Something isn't working label Mar 21, 2024
@89luca89
Copy link
Owner

Hi @mcepl

to be clear

1 - you use this ini file

[vis]
image="registry.opensuse.org/home/mcepl/moldavite/containers/opensuse/vis-master:latest"
pull=true
replace=true

2 - you do distrobox assemble create -n vis
3 - you distrobox enter vis
4 - you distrobox-export --bin /usr/bin/vis

then when you run the exported binary, you get an error?

@89luca89 89luca89 added the wait-on-user waiting for a reply label Mar 25, 2024
@mcepl
Copy link
Contributor Author

mcepl commented Mar 26, 2024

then when you run the exported binary, you get an error?

Now this works, but if I run later distrobox assemble create -n vis again (to update the container) then it fails.

Or do you have any other means how to update a container? I was thinking about this script as an alternative, but I would prefer to stay with already existing distrobox commands (and I am not sure how reliable it is anyway):

#!/bin/bash
# shellcheck disable=SC2086
set -eux

root='' # false

usage()
{
   # Display Help
   echo "Upgrade image of a distrobox container"
   echo
   echo "Syntax: distrobox-pull [-h] NAME"
   echo "options:"
   echo "h     Print this Help."
   echo
   exit 1
}

while getopts "hr" option; do
   case $option in
      h) # display Help
         usage
         ;;
      r) # we will use root container
         root=1
         ;;
      \?) # Invalid option
         echo "Error: Invalid option"
         exit 1
         ;;
   esac
done

shift $((OPTIND - 1))
if [ $# -lt 1 ]
then
    usage
fi

NAME=$1
if [ $root ] ; then
    sudo podman ps|awk '/"'$NAME'"/ { print $0 }'
    IMG_NAME=$(sudo podman ps|awk '$NF == "'$NAME'" {print $2}')
    sudo podman stop "$NAME"
    distrobox rm --root "$NAME"
    distrobox create --root --pull --name "$NAME" --image "$IMG_NAME"
else
    podman ps|awk '/"'$NAME'"/ { print $0 }'
    IMG_NAME="$(podman ps|awk '$NF == "'$NAME'" {print $2}')"
    podman stop "$NAME"
    distrobox rm "$NAME"
    distrobox create --pull --name "$NAME" --image "$IMG_NAME"
fi

And yes this doesn’t work either, because it breaks on distrobox rm again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wait-on-user waiting for a reply
Projects
None yet
Development

No branches or pull requests

2 participants