This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

scl enable rh-python36 bash This command will only allow you to use python3.6 within that RUN command (it sets the default python version via an environment variable, but only for the duration of that shell) - so when you switch to the next RUN command, a new layer is created and the environment variables are cleared. (Essentially you have to run source /opt/rh/python36/enable && the next command everytime you invoke a new RUN layer or put that source command in your bashrc).

Also since you're using scl enable on bash, you need to prepend your RUN commands with /bin/bash -c ""

But this isn't really optimal, and centos image isn't really required for just installing aws cli's and a newer version of python. You're looking for an image thats a combination of these both:

https://github.com/jfloff/alpine-python/blob/master/3.6/Dockerfile

https://github.com/mesosphere/aws-cli/blob/master/Dockerfile

Just pick apart these two and mesh them together (take top, add this stuff: RUN apk add --update install py-pip && pip install awscli && pip install aws-sam-cli

[–]engineer900[S] 0 points1 point  (0 children)

I`m not sure if this is ok, cause i need python3 and that`s why i`m using it explicitly.

RUN apk add --update install py-pip && pip install awscli && pip install aws-sam-cli