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

Arch Toolbox container image #328

Closed
wants to merge 7 commits into from
Closed

Arch Toolbox container image #328

wants to merge 7 commits into from

Conversation

erazemk
Copy link
Contributor

@erazemk erazemk commented Nov 7, 2019

I'm creating an Arch base for toolbox.

Currently I get the error toolbox: failed to get the tag of image ./Dockerfile and I'm new to Podman/Buildah, so I don't know how to tag the file or if I should even use either of those to make the image.

  • I've taken most of the packages from the Fedora images, but have replaced them with Arch equivalents.
  • The VERSION variable doesn't really apply to Arch, so for now I've set it to "rolling", but any input on this would be very helpful.

Todo:

  • Check if other packages are needed due to Arch changing base
  • Test image

Copy link
Member

@HarryMichal HarryMichal left a comment

Choose a reason for hiding this comment

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

Hi @erazemkokot, thanks for your interest in Toolbox and for this PR. I left some comments.

images/arch/Dockerfile Outdated Show resolved Hide resolved
images/arch/Dockerfile Show resolved Hide resolved
# Clean up all local caches
RUN pacman -Scc

CMD /bin/sh
Copy link
Member

Choose a reason for hiding this comment

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

I tried to build the image and when I got to this point, it errored out with no such command. That'll probably need some investigation??

Copy link
Contributor Author

@erazemk erazemk Nov 8, 2019

Choose a reason for hiding this comment

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

I've tested pacman -Scc and it works fine, did you mean no such command for /bin/sh or pacman?

Copy link
Member

Choose a reason for hiding this comment

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

For CMD /bin/sh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll check it out (I'm pretty sure it was because bash is a part of the base metapackage now and I haven't added it yet when you were testing the image).

images/arch/extra-packages Show resolved Hide resolved
@HarryMichal HarryMichal added the 2. Images Images for creating toolbox containers label Nov 8, 2019
@erazemk
Copy link
Contributor Author

erazemk commented Nov 8, 2019

@HarryMichal Thanks for the reply. Can you please tell me what I need to do to properly run the container, since I get the error in the first comment and can't even start it.

@HarryMichal
Copy link
Member

Disclaimer: I'm no expert at building container images. I'm still discovering this.

First, you need to build the image before you can use it with Toolbox. My process looked like this:

$ cd <toolbox_dir>/images/arch
$ podman build .

The podman command can be replaced by buildah build-using-dockerfile. But this command doesn't work for me even with the already existing fedora Dockerfiles, so there is most likely more to it.

Maybe we should expand the README (or the GitHub Wiki or even the Fedora Wiki) with some instructions for image building. What do you think @debarshiray, @juhp??

@erazemk
Copy link
Contributor Author

erazemk commented Nov 8, 2019

Maybe we should expand the README (or the GitHub Wiki or even the Fedora Wiki) with some instructions for image building.

I haven't read much documentation on podman yet, but I, and I'm sure a lot of other people, would appreciate a section in the readme dedicated to manually building images.

@kronenpj
Copy link

kronenpj commented Nov 8, 2019

@HarryMichal

The podman command can be replaced by buildah build-using-dockerfile. But this command doesn't work for me even with the already existing fedora Dockerfiles, so there is most likely more to it.

If you're using an up-to-date buildah there's a bug report open which, when fixed, will address a message like:
error building at STEP "COPY README.md /": secure join: too many levels of symbolic links
A temporary workaround is to rm README.md and cp ../../../README.md .

Otherwise using buildah bud -t f32-toolbox . worked for me just now.

@kronenpj
Copy link

kronenpj commented Nov 8, 2019

@erazemkokot
I'm not that familiar with Arch, but if the default "FROM" container has removed the documentation or man pages, you may want to re-install them. This way the person using the toolbox has the documentation available from the toolbox distribution.

In Fedora the approach was to take a selection of the packages and re-install them. Ubuntu container had a script /usr/local/sbin/unminimize that identified and re-installed packages where documentation was missing. Arch may have a similar approach.

@erazemk
Copy link
Contributor Author

erazemk commented Nov 9, 2019

I'm not that familiar with Arch, but if the default "FROM" container has removed the documentation or man pages, you may want to re-install them. This way the person using the toolbox has the documentation available from the toolbox distribution.

I'll check, thanks for the warning.

palazzem added a commit to palazzem/archlinux-toolbox that referenced this pull request Jan 4, 2020
Copy link

@njam njam left a comment

Choose a reason for hiding this comment

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

I've tested this, and can confirm that it works (toolbox create and toolbox enter).

For it to work I had to change two things in toolbox itself:

images/arch/Dockerfile Show resolved Hide resolved
images/arch/Dockerfile Outdated Show resolved Hide resolved
Erazem Kokot and others added 2 commits April 5, 2020 16:28
Co-Authored-By: Reto Kaiser <reto@retoonline.com>
Co-Authored-By: Reto Kaiser <reto@retoonline.com>
@softwarefactory-project-zuul
Copy link

Build succeeded.

@erazemk
Copy link
Contributor Author

erazemk commented Jul 30, 2020

I'm going to close this to give it a new - clean - shot, keeping in mind all the tips I got so far.

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

Successfully merging this pull request may close these issues.

4 participants