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

Missing environment variables in devel Docker container #4896

Open
3 tasks done
amadeuszsz opened this issue Jun 20, 2024 · 0 comments
Open
3 tasks done

Missing environment variables in devel Docker container #4896

amadeuszsz opened this issue Jun 20, 2024 · 0 comments

Comments

@amadeuszsz
Copy link
Contributor

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I'm convinced that this is not my fault but a bug.

Description

After running development container, environment variables set via ansible script doesn't exist.

Expected behavior

All the environment variables set via ansible script are reflected for user while running Docker image with --devel flag.

Actual behavior

/home/${USER}/.bashrc doesn't contain environment variables. The missing variables are:

export PATH="$PATH:/root/.local/bin"
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CCACHE_DIR="/var/tmp/ccache"
export CC="/usr/lib/ccache/gcc"
export CXX="/usr/lib/ccache/g++"
export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"

It causes multiple issues, e.g. running ROS 2 daemon with rmw_fastrtps_cpp DDS.

Steps to reproduce

./docker/run.sh --devel
cat $HOME/.bashrc
sudo su
cat $HOME/.bashrc

Versions

No response

Possible causes

Command exec /usr/sbin/gosu "$USER_NAME" "$@" from docker/etc/ros_entrypoint.sh run bash as user with default .bashrc file. We can fix this two ways:

  • Handle /etc/skel/.bashrc in ansible scripts. That means push all environment variables to two .bashrc files at the same time. In that case we will need to change export PATH="$PATH:/root/.local/bin" to export PATH="$PATH:\$HOME/.local/bin". I'm not sure if \ will keep $ in scripts as a special sign here. It has to be validated.
  • Add variables to $HOME/.bashrc via ros_entrypoint.sh. Copying /root/.bashrc is also possible if we modify export PATH="$PATH:/root/.local/bin" as described previously.

Additional context

No response

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

No branches or pull requests

1 participant