I have a dockerfile building oel6 linux that uses the SCL python27.

For the docker build, using the SHELL command works to execute the commands correctly (i.e. if i were to insert a RUN python --version i get 2.7).

Creating a /root/.bashrc that sets source scl_source enable python27 works great for any interactive sessions with the container (python --version 2.7)

However, any commands executed non-interactively (i.e. docker run oel6 pyhton --version) is always 2.6 no matter what i try.

Take what i've tried with a grain of salt as i may have tried it incorrectly but i've tried setting the entrypoint as the command, i've tried executing a script that contains the commands as an entrypoint, i've tried putting it in /etc/profile.d/.

Any help appreciated.

  • I suggest that you share your Dockerfile / entrypoint script to get better help – Chaoxiang N Aug 16 '19 at 6:23
  • 1
    Why on earth are you using oel6 and trying to add SCL python27 on it in a docker container?!! – Michael Hampton Aug 16 '19 at 8:04
  • I don't make the rules, mike, i just follow them. – Taekahn Aug 16 '19 at 15:52
  • Yes, but when they're apparently ridiculous, you should at least question what is going on. – Michael Hampton Aug 16 '19 at 19:14

I eventually found this site: https://austindewey.com/2019/03/26/enabling-software-collections-binaries-on-a-docker-image/

I had my entrypoint script wrong. What works is:

source scl_source enable python27
exec "$@"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.