0

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.

Taekahn
  • 111
  • 4

1 Answers1

1

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:

#!/bin/bash
source scl_source enable python27
exec "$@"
Taekahn
  • 111
  • 4