Hide Forgot
The situation described bellow for devtoolset-4-toolchain-rhel7 image is true also for devtoolset-4-perftools-rhel7, therefore cloning the bug. +++ This bug was initially created as a clone of Bug #1323575 +++ Description of problem: X_SCLS environmental variable - among many others - is not set for all commands that can be executed using docker-4-toolchain image. It loos like the variable exists only when bash gets involved: .qa.[root@ibm-x3630m4-01 ~]# docker run --rm rhscl/devtoolset-4-toolchain-rhel7 bash -c 'env' MANPATH=/opt/rh/devtoolset-4/root/usr/share/man: HOSTNAME=cb70ccd9b20d PERL5LIB=/opt/rh/devtoolset-4/root//usr/lib64/perl5/vendor_perl:/opt/rh/devtoolset-4/root/usr/lib/perl5:/opt/rh/devtoolset-4/root//usr/share/perl5/vendor_perl X_SCLS=devtoolset-4 JAVACONFDIRS=/opt/rh/devtoolset-4/root/etc/java:/etc/java PCP_DIR=/opt/rh/devtoolset-4/root LD_LIBRARY_PATH=/opt/rh/devtoolset-4/root/usr/lib64:/opt/rh/devtoolset-4/root/usr/lib XDG_CONFIG_DIRS=/opt/rh/devtoolset-4/root/etc/xdg:/etc/xdg PATH=/opt/rh/devtoolset-4/root/usr/bin:/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-4/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PKGM=yum PWD=/opt/app-root/src SHLVL=1 HOME=/opt/app-root/src PYTHONPATH=/opt/rh/devtoolset-4/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-4/root/usr/lib/python2.7/site-packages XDG_DATA_DIRS=/opt/rh/devtoolset-4/root/usr/share:/usr/local/share:/usr/share INFOPATH=/opt/rh/devtoolset-4/root/usr/share/info container=docker _=/usr/bin/env .qa.[root@ibm-x3630m4-01 ~]# Compare with: .qa.[root@ibm-x3630m4-01 ~]# docker run --rm rhscl/devtoolset-4-toolchain-rhel7 env PATH=/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-4/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=1857734cceaf container=docker PKGM=yum HOME=/opt/app-root/src BASH_ENV=/opt/app-root/etc/scl_enable ENV=/opt/app-root/etc/scl_enable PROMPT_COMMAND=. /opt/app-root/etc/scl_enable .qa.[root@ibm-x3630m4-01 ~]# For example, when I decide to use python scripting, my scripts won't have any information about enabled collections: .qa.[root@ibm-x3630m4-01 ~]# docker run --rm rhscl/devtoolset-4-toolchain-rhel7 python -c 'import os, pprint; pprint.pprint(dict(os.environ), width=1)' {'BASH_ENV': '/opt/app-root/etc/scl_enable', 'ENV': '/opt/app-root/etc/scl_enable', 'HOME': '/opt/app-root/src', 'HOSTNAME': '10d760a7149d', 'PATH': '/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-4/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PKGM': 'yum', 'PROMPT_COMMAND': '. /opt/app-root/etc/scl_enable', 'container': 'docker'} .qa.[root@ibm-x3630m4-01 ~]# Version-Release number of selected component (if applicable): rhscl/devtoolset-4-toolchain-rhel7, release 9.2 (95d79b670a3a) How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: --- Additional comment from Marek Polacek on 2016-04-04 12:17:23 CEST --- Bah, I thought # Enable the SCL for all bash scripts. ENV BASH_ENV=/opt/app-root/etc/scl_enable \ ENV=/opt/app-root/etc/scl_enable \ PROMPT_COMMAND=". /opt/app-root/etc/scl_enable" was supposed to handle all these cases. Not sure yet why it is ignored. --- Additional comment from Marek Polacek on 2016-04-04 13:00:14 CEST --- Note that devtoolset-4-perftools-docker behaves the same.
FYI, we found a possible solution, see https://bugzilla.redhat.com/show_bug.cgi?id=1323575#c9 and later.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2016:1151