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

First attempt at an Ubuntu toolbox container image. #298

Closed
wants to merge 4 commits into from

Conversation

kronenpj
Copy link

@kronenpj kronenpj commented Oct 13, 2019

This isn't as clean as the fedora/centos variants. There's also a problem on first run where toolbox
emits 'toolbox: failed to create /run/.toolboxenv in container' but runs normally from there.

This isn't as clean as the fedora/centos variants. There's also a problem on first run where toolbox
emits 'toolbox: failed to create /run/.toolboxenv in container' but runs normally from there.
Copy link
Member

@debarshiray debarshiray left a comment

Thank you for working on this! It looks very good. Some comments below:

images/ubuntu/19.04/Dockerfile Outdated Show resolved Hide resolved
images/ubuntu/19.04/Dockerfile Outdated Show resolved Hide resolved
images/ubuntu/19.04/Dockerfile Outdated Show resolved Hide resolved
version="$VERSION" \
usage="This image is meant to be used with the toolbox command" \
summary="Base image for creating Ubuntu 19.04 toolbox containers" \
maintainer="Debarshi Ray <rishi@fedoraproject.org>"
Copy link
Member

@debarshiray debarshiray Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I convince you to be the maintainer of these Ubuntu images? :)

Copy link
Author

@kronenpj kronenpj Oct 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, I only use Centos and Fedora. Debian and its derivatives aren't anything I work with normally. I really just did this one as a demonstration.

Copy link
Member

@debarshiray debarshiray Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Before we announce support for Ubuntu, we would need somebody who cares enough about Ubuntu to ensure that Toolbox keeps working on a day to day basis with Ubuntu hosts and images. I am a little apprehensive of taking up that responsibility myself. I could, but it seems wise to spread the load around a bit.

Copy link
Member

@debarshiray debarshiray Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, in the meantime, we can work towards removing the rough edges before thinking of making any announcements. :)

Copy link
Author

@kronenpj kronenpj Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

images/ubuntu/19.04/Dockerfile Show resolved Hide resolved
images/ubuntu/19.04/Dockerfile Show resolved Hide resolved
images/ubuntu/19.04/Dockerfile Show resolved Hide resolved
images/ubuntu/19.04/extra-packages Outdated Show resolved Hide resolved
@evan-a-a
Copy link

evan-a-a commented Oct 27, 2019

I just spent about an hour putting together a Ubuntu toolbox container (using buildah) - then I found this! Looks like we came to the same conclusions on what's needed to make Ubuntu happy inside of podman/toolbox.

I do have an issue with sudo complaining about not being able to resolve the toolbox hostname. I'm guessing this is due to it not being listed in /etc/hosts, but it's the same for Fedora and no complaints there. Ubuntu must be more strict about hostnames in /etc/hosts.

@nanonyme
Copy link
Contributor

nanonyme commented Oct 27, 2019

About /etc/hosts https://github.com/containers/toolbox/blob/master/toolbox#L1079 it's supposed to get indirected. Maybe check if it's already a symlink in the image?

images/ubuntu/19.04/Dockerfile Show resolved Hide resolved
@@ -0,0 +1,17 @@
bash-completion
Copy link
Member

@debarshiray debarshiray Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious. Did you check that these packages are the ones missing from the Ubuntu base image that are necessary to replicate the command line user experience on a usual Ubuntu host?

To be honest, I am not sure what's the most future-proof option here. We started off by trying to replicate the default Fedora Workstation/Silverblue CLI UX in the Toolbox images. However, now that we are adding other distributions, and supporting different variants of Fedora other than Silverblue and Workstation, I don't know what a freshly created container should have.

Copy link
Author

@kronenpj kronenpj Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's part of the reason I don't want to maintain the Ubuntu toolbox image. I don't actually use the distribution, so I can't say what a "usual" user experience would be for it.

images/ubuntu/19.04/README.md Show resolved Hide resolved
@evan-a-a
Copy link

evan-a-a commented Nov 3, 2019

About /etc/hosts https://github.com/containers/toolbox/blob/master/toolbox#L1079 it's supposed to get indirected. Maybe check if it's already a symlink in the image?

It's being properly indirected inside the container, but /etc/hosts contains the hostname dockerhost but not toolbox.

@kronenpj kronenpj requested a review from debarshiray Nov 8, 2019
@HarryMichal HarryMichal added the 2. Images label Dec 5, 2019
@markstos
Copy link

markstos commented Dec 26, 2019

Having a Ubuntu container could help driving conversions from Ubuntu users. It looks like this has been pending a review since early November. Supporting a Ubuntu LTS container would be great too.

@markstos
Copy link

markstos commented Jan 3, 2020

I tested this image as follows:

  1. I downloaded the files in images/ubuntu/19.04 to my home directory on Silverblue 31.
  2. I ran podman build images/ubuntu/19.04. (I tried running podman build images/19.04/Dockerfile, but that segfault'ed)
  3. I ran podman images to confirm the image was built and what the image ID was.
  4. I ran toolbox create --container ubuntu-disco --image 703d46da649e to use the local image
  5. I ran toolbox enter --container ubuntu-disco to enter the local container.

Unfortunately, the container exits immediately with an return value of 127. According to man podman-exec, this return status means contained command cannot be found.

Here's the final output of running the toolbox enter command with sh -x:

+ podman exec --interactive --tty --user mark --workdir /var/home/mark --env=COLORTERM=truecolor --env=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus --env=DESKTOP_SESSION=gnome --env=DISPLAY=:0 --env=LANG=en_US.UTF-8 --env=SHELL=/bin/bash --env=SSH_AUTH_SOCK=/run/user/1000/keyring/ssh --env=TERM=xterm-256color --env=VTE_VERSION=5803 --env=WAYLAND_DISPLAY=wayland-0 --env=XDG_CURRENT_DESKTOP=GNOME --env=XDG_DATA_DIRS=/var/home/mark/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop --env=XDG_MENU_PREFIX=gnome- --env=XDG_RUNTIME_DIR=/run/user/1000 --env=XDG_SESSION_DESKTOP=gnome --env=XDG_SESSION_TYPE=wayland --env=COLUMNS=158 --env=LINES=37 ubuntu-disco capsh --caps= -- -c 'exec "$@"' /bin/sh /bin/bash -l
+ ret_val=127
+ true
+ printf '\033]777;container;pop;;\033\'
+ exit 127
+ exit

@kronenpj
Copy link
Author

kronenpj commented Jan 4, 2020

@markstos: Looking into your concern. I can't get toolbox to create a container from the image number:

$ toolbox create --container ubuntu-disco --image e29401ae3372
toolbox: failed to get RepoTag for base image e29401ae3372

Once I tag that image, I can create the toolbox container:

$ podman tag e29401ae3372 ubuntu-tool
$ toolbox create --container ubuntu-disco --image ubuntu-tool
Created container: ubuntu-disco
Enter with: toolbox enter --container ubuntu-disco

The container then "works for me:"

$ toolbox enter --container ubuntu-disco
⬢[kronenpj@toolbox toolbox]$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
...

I'm not sure what's going on here. @debarshiray thoughts?

@markstos
Copy link

markstos commented Jan 6, 2020

@kronenpj I got the image ID from the output of podman images. Is that where you got the value that failed as well?

@kronenpj
Copy link
Author

kronenpj commented Jan 7, 2020

@markstos Yes, I did leave that step out. I think it was actually podman image ls but it's the same output.

@martinpitt
Copy link
Contributor

martinpitt commented Mar 13, 2020

For anyone who wants to use ubuntu containers with toolbox now: I have a script that can build a debian or ubuntu container for any release from the stock dockerhub images.

@markstos
Copy link

markstos commented Mar 13, 2020

@martinpitt Thanks. I see a comment in there about systemd. Does systemd work inside these containers?

I also see that libwww-perl is being installed as a dev tool. What's it used for these days? I used to install it to use the GET and HEAD binaries, but these days httpie seems like better HTTP CLI tool.

@martinpitt
Copy link
Contributor

martinpitt commented Mar 14, 2020

@markstos : systemd is not really being used in the containers. It's just commonly getting installed as a build dependency, and /var/log/journal/ being a bind mount to the real system confuses the package postinst script, so the package fails to install.

I forgot about the particular reason for libwww-perl, I think a tool like dget or dput needs it. I reduced dependencies with --no-install-recommends, but that was one which at least I need. You can of course try with dropping deps that you don't need, and just install them later on demand.

@mjlbach
Copy link
Contributor

mjlbach commented Mar 23, 2020

@martinpitt When I use your script to try to make an ubuntu container, I get the following error:

❯ bash make_debian_container.sh 18.04 ubuntu
+ RELEASE=18.04
+ DISTRO=ubuntu
+ toolbox rm -f 18.04
+ toolbox -y create -c 18.04 --image docker.io/ubuntu:18.04
Created container: 18.04
Enter with: toolbox enter --container 18.04
+ podman start 18.04
Error: unable to start container "18.04": error looking up supplemental groups for container 86982a6dffded63fb77cfe6c74a80e08f349012672d0de7ee9466817a93993fb: Unable to find group wheel

@martinpitt
Copy link
Contributor

martinpitt commented Mar 23, 2020

@mjlbach : Indeed I get the same now, on any Debian/Ubuntu release. That smells like a recent podman regression, I'll look into it this evening.

@martinpitt
Copy link
Contributor

martinpitt commented Apr 2, 2020

@mjlbach : I sent PR #401 to fix the sudo/wheel group issue.

@heyakyra
Copy link

heyakyra commented Jan 21, 2021

What's the current status of this?

@j1mc
Copy link

j1mc commented Mar 11, 2021

I'm grateful everyone's work on this thus far. I know that Ubuntu might not be Redhat / Fedora folk's primary target here, but any update would be appreciated.

Base automatically changed from master to main Mar 25, 2021
@reesericci
Copy link

reesericci commented Jul 8, 2021

What's the current status of this?

looking for the same

@acmel
Copy link

acmel commented Oct 18, 2021

I'm also interested in running Ubuntu in a container on fedora silverblue, any update on this?

@nanonyme
Copy link
Contributor

nanonyme commented Oct 18, 2021

I'm not sure that use case will actually work until this project sorts out glibc compatibility issues

@Jmennius
Copy link

Jmennius commented Oct 31, 2021

Please try images from #483 PR - they should be more complete and few recent LTS releases are available.

@debarshiray
Copy link
Member

debarshiray commented Dec 1, 2021

Hey @kronenpj did you receive my email to your kronenpj@gmail.com inbox earlier this year to work out the specifics of offering out-of-the-box Ubuntu support? It was titled Toolbox: Ubuntu suport, and was from rishi.is@lostca.se.

@debarshiray
Copy link
Member

debarshiray commented Dec 1, 2021

Hey @kronenpj did you receive my email to your kronenpj@gmail.com
inbox earlier this year to work out the specifics of offering out-of-the-box
Ubuntu support? It was titled Toolbox: Ubuntu suport, and was from
rishi.is@lostca.se.

My apologies. I just remembered that you had already mentioned on this pull request that you don't want to maintain the Ubuntu support because you don't actually use it and you only did it as a demo.

I have marked those conversation threads as unresolved so that they don't get hidden in the noise.

@debarshiray
Copy link
Member

debarshiray commented Dec 1, 2021

I am closing this pull request since @kronenpj doesn't want to maintain the Ubuntu support long-term, and we can't merge stuff that has nobody maintaining it.

@debarshiray debarshiray closed this Dec 1, 2021
@debarshiray
Copy link
Member

debarshiray commented Dec 1, 2021

Let's focus on #483 which is more active. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. Images
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet