Skip to content

Arch Toolbox container image - #328

Closed
erazemk wants to merge 7 commits into
containers:masterfrom
erazemk:master
Closed

erazemk wants to merge 7 commits into
containers:masterfrom
erazemk:master

Conversation

@erazemk

@erazemk erazemk commented Nov 7, 2019 •

Copy link
Copy Markdown
Contributor

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

@martymichal martymichal left a comment

Copy link
Copy Markdown
Member

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.

Comment thread images/arch/Dockerfile Resolved
Comment thread images/arch/Dockerfile Resolved
Comment thread images/arch/Dockerfile
# Clean up all local caches
RUN pacman -Scc

CMD /bin/sh

Copy link
Copy Markdown
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??

@erazemk erazemk Nov 8, 2019 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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).

Comment thread images/arch/extra-packages Resolved
@martymichal martymichal added the 2. Images Images for creating toolbox containers label Nov 8, 2019
@erazemk

erazemk commented Nov 8, 2019

Copy link
Copy Markdown
Contributor Author

@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.

@martymichal

Copy link
Copy Markdown
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

erazemk commented Nov 8, 2019

Copy link
Copy Markdown
Contributor Author

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

kronenpj commented Nov 8, 2019

Copy link
Copy Markdown

@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

kronenpj commented Nov 8, 2019

Copy link
Copy Markdown

@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

erazemk commented Nov 9, 2019

Copy link
Copy Markdown
Contributor Author

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

@njam njam left a comment

Copy link
Copy Markdown

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:

  • #404 When bind-mounting a file, create the target path if it doesn't exist
  • #405 Don't try to remove /media if it doesn't exist

Comment thread images/arch/Dockerfile Resolved
Comment thread images/arch/Dockerfile Resolved
Erazem Kokot and others added 2 commits April 5, 2020 16:28
@softwarefactory-delete-me

Copy link
Copy Markdown

Build succeeded.

@erazemk

erazemk commented Jul 30, 2020

Copy link
Copy Markdown
Contributor Author

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