-
Notifications
You must be signed in to change notification settings - Fork 223
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
Add Arch Linux toolbox image #710
Conversation
This commit adds an Arch Linux image, created from the upstream base-devel branch. It includes most of the packages that the Fedora-based images do, but currently excludes flatpak (required for flatpak-spawn), since it adds ~690 MB of extra packages/dependencies. The base-devel image (without any extra packages) is 729 MB, when syncing repositories 741 MB and with all the packages (excluding flatpak) 831 MB, which should be the minimum if based on archlinux:base-devel.
Build succeeded.
|
Didn't work for me, but I figured it out. Adding this line to the Dockerfile fixed that.
|
I just now realized that the proper way to create and test custom images is by building them and using I tried running the container that way, but got the error bash: PROMPT_COMMAND: line 0: syntax error near unexpected token `;'
bash: PROMPT_COMMAND: line 0: ` ; printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"' Do you not get this error and if so, which OS are you using? |
I'm not getting that error; I'm not sure where that is coming from (it doesn't match any code in
|
See discussion on containers#710.
It seems the problem was indeed with this, I use the fish shell, so I don't have a local bashrc file, just the system one (which I haven't changed). This is weird though, since I based the Dockerfile off of the Fedora files, which work normally with toolbox. Copying the root user's bashrc doesn't help either, I still get the same error (even after removing the part that sources /etc/bashrc).
When replacing if [ -z "$PROMPT_COMMAND" ]; then
case $TERM in
xterm*|vte*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then
PROMPT_COMMAND="__vte_prompt_command"
else
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
fi
;;
screen*)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
fi
;;
*)
[ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
;;
esac
fi
# Turn on parallel history
shopt -s histappend |
Yeah, I use Zsh. This tells me that the error is in Arch's bash config. It has this construct in case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
screen*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
esac Somehow the expansion if ! [ -f /etc/profile.d/vte.sh ] && [ -z "$PROMPT_COMMAND" ] && [ "${VTE_VERSION:-0}" -ge 3405 ]; then
case "$TERM" in
xterm*|vte*)
[ -n "${BASH_VERSION:-}" ] && PROMPT_COMMAND=" "
;;
esac
fi To play nice with Arch, this should be EDIT: The root cause is __vte_prompt_command , defined in /etc/profile.d/vte.sh (in pkg vte-profile) and used in /etc/bashrc (in setup). Conversation and fix here. This fix is recent, so the workaround here is still necessary for Fedora versions <= 33 afaik. |
See discussion on containers#710. Other users may also append a prompt command in a similar way. Making this a `:` instead ensures that an appended command will not cause an error.
A subsequent commit will handle a missing containerPath when bind mounting a regular file like /etc/machine-id. Therefore, it's better to explicitly state that this code is dealing with a directory. containers#710
Errors thrown from 'toolbox init-container' are usually not shown to the user. One has to use 'podman start --attach ...' to see them. Therefore, it's worth adding the extra bit of information to the error. containers#710
Since, /etc/machine-id is bind mounted into the toolbox container from the host operating system, it doesn't make sense to make it mandatory for images to have that file. Apparently, (some?) Arch Linux images don't have /etc/machine-id. Since a missing containerPath for a directory is handled the same way, there's no reason not to do the same for regular files. It will make life a bit easier for those creating toolbox images for different distributions. containers#710
Since /etc/machine-id is bind mounted into the toolbox container from the host operating system, it doesn't make sense to make it mandatory for images to have that file. Apparently, (some?) Arch Linux images don't have /etc/machine-id. Since a missing containerPath for a directory is handled the same way, there's no reason not to do the same for regular files. It will make life a bit easier for those creating toolbox images for different distributions. containers#710
A subsequent commit will handle a missing containerPath when bind mounting a regular file like /etc/machine-id. Therefore, it's better to explicitly state that this code is dealing with a directory. containers#710
Errors thrown from 'toolbox init-container' are usually not shown to the user. One has to use 'podman start --attach ...' to see them. Therefore, it's worth adding the extra bit of information to the error. containers#710
Since /etc/machine-id is bind mounted into the toolbox container from the host operating system, it doesn't make sense to make it mandatory for images to have that file. Apparently, (some?) Arch Linux images don't have /etc/machine-id. Since a missing containerPath for a directory is handled the same way, there's no reason not to do the same for regular files. It will make life a bit easier for those creating toolbox images for different distributions. containers#710
@erazemk: I closed #716 about the profile errors, Arch's image should add the Additionally, /etc/machine-id being absent is no longer an issue. 🙂 |
This PR builds on the previous tries (#328 and #520) of including an Arch Linux image in toolbox.
The PR adds an Arch Linux image, created from the upstream base-devel branch.
It includes most of the packages that the Fedora-based images do, but currently excludes flatpak (required for flatpak-spawn), since it adds ~690 MB of extra packages/dependencies.
The base-devel image (without any extra packages) is 729 MB, when syncing repositories 741 MB and with all the packages (excluding flatpak) 831 MB, which should be the minimum if based on archlinux:base-devel.
If the final size is very important I can try and base it off of
archlinux:latest
(which includes only the base packages, not base-devel), but that would still require adding some of the missing packages - although the base image size is 416 MB, which is quite an improvement..Another option could be to separate latest and base-devel versions into separate images, similarly to what is done with Fedora versions.
I can also add the yay AUR helper if there is a need for it.