You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Cannot pass variables to use when declared in the manifest files, so if i have a hook which does pre_init_hook="export SOME_VAL=" the SOME_VAL will never be seen by the container as a variable but instead it will get processed by the host.
Another issue caused by letting host handle these vars is the usage of existing env vars like $HOME which redirect to host HOME but i assumed to point to the containers home.
Describe the solution you'd like
allow passing hooks to to distrobox-create as encoded strings which are later decoded to only use variables on the container and not on the host. Could have the flag --encoded-hooks which would indicate to create that it should decode them first before attempting to evaluate them.
Describe alternatives you've considered
A workaround i found was to wrap the distrobox assemble --file filename.ini to another sh script that sets the variables from there and then when they eventually get passed down those vars exist and are not unbound. This workaround is fine but can cause problems when i need to create a variable specific to the containers current state which my host machine will not have access to at that moment. To create and have access l vars during runtime of container files could be used to store values but this still lews desirable than having access to vars during container runtine.
Example
#!/bin/shexport INTELLJ_TOOLBOX_VER="2.5.2.35332"# a var that exists and is called to by hooks in filename.ini
distrobox assemble create --file filename.ini
unset INTELLJ_TOOLBOX_VER
Additional context
incomplete manifest file i tried to use
[dev]image=ubuntu:latest
pull=false
start_now=false
entry=true
home="/home/.containers/dev"root=false
unshare_ipc=true
unsahare_devsys=true
unshare_process=true
unshare_netns=false
unshare_groups=false
nvidia=false
init=false
# Mount/link required folders and set env vars# NOTE: some things here like version are hardcoded and need to be changed frequently (find way to avoid this i.e. have a look at https://phantomjs.org/)pre_init_hooks="mkdir $HOME/Documents && ln -s /home/amon/Documents/Programming $HOME/Documents/"pre_init_hooks="mkdir $HOME/Downloads/setup && export SETUP_LOC=$HOME/Downloads/setup"pre_init_hooks='export INTELLJ_TOOLBOX_VERSION="2.5.2.35332"'# Download required files# TODO: just generate expect scripts and run those with the appropriate curl or wget command instead of downloading files first and processing laterpre_init_hooks="wget -q -O- 'https://download.jetbrains.com/toolbox/jetbrains-toolbox-${INTELLJ_TOOLBOX_VERSION}.tar.gz' | tar -xz -C $SETUP_LOC"pre_init_hooks="curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org -o $SETUP_LOC/ghcup"pre_init_hooks="curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o $SETUP_LOC/rustup"pre_init_hooks="curl -L https://install.perlbrew.pl -o $SETUP_LOC/perlbrew"pre_init_hooks="curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh -o $SETUP_LOC/nvm"pre_init_hooks="curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer -o $SETUP_LOC/gvm"pre_init_hooks="curl https://pyenv.run -o $SETUP_LOC/pyenv"pre_init_hooks="curl -s 'https://get.sdkman.io' -o $SETUP_LOC/sdkman"pre_init_hooks="curl -fsSL https://raw.githubusercontent.com/dhavalkapil/luaver/master/install.sh -o $SETUP_LOC/luaver"# first line pkgs required for jetbrains toolbox appimage to work# second line some shared libs to get common things to work# expect required for script automation for ghcup and other related scriptsadditional_packages="libfuse2 libxi6 libxrender1 libxtst6 mesa-utils libfontconfig libgtk-3-bin tar dbus-user-session"additional_packages="libnss3 libasound2t64"# NOTE: fish shell might not be required as it looks like distrobox auto picks it upadditional_packages="git"additional_packages="clang gcc gdb nasm"additonal_packages="expect"init_hooks="$SETUP_LOC/jetbrains-toolbox-${INTELLJ_TOOLBOX_VERSION}/jetbrains-toolbox"# TODO: automate with expect init_hooks="echo y | socat stdio exec:$SETUP_LOC/ghcup,pty,setsid,echo=0"exported_bins="/usr/bin/git"exported_apps="$HOME/.local/share/applications/jetbrains-toolbox.desktop"# cleanup (remove script automation tool)init_hooks="sudo apt -y purge expect"init_hooks="rm -rf $SETUP_LOC && unset SETUP_LOC"init_hooks="unset INTELLJ_TOOLBOX_VERSION"
The text was updated successfully, but these errors were encountered:
After trying init_hooks it seems to use the vars in the actual way that i assumed it did (for pre_init_hooks) and it now feels clear that pre_init is meant to be used before the container is even setup so my solutions and manifest file would not even work as intended.
Is your feature request related to a problem? Please describe.
Cannot pass variables to use when declared in the manifest files, so if i have a hook which does
pre_init_hook="export SOME_VAL="
the SOME_VAL will never be seen by the container as a variable but instead it will get processed by the host.Another issue caused by letting host handle these vars is the usage of existing env vars like $HOME which redirect to host HOME but i assumed to point to the containers home.
Describe the solution you'd like
allow passing hooks to to distrobox-create as encoded strings which are later decoded to only use variables on the container and not on the host. Could have the flag
--encoded-hooks
which would indicate tocreate
that it should decode them first before attempting to evaluate them.Describe alternatives you've considered
A workaround i found was to wrap the distrobox assemble --file filename.ini to another sh script that sets the variables from there and then when they eventually get passed down those vars exist and are not unbound.
This workaround is fine but can cause problems when i need to create a variable specific to the containers current state which my host machine will not have access to at that moment.To create and have access l vars during runtime of container files could be used to store values but this still lews desirable than having access to vars during container runtine.Example
Additional context
incomplete manifest file i tried to use
The text was updated successfully, but these errors were encountered: