Open
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- I'd be willing to implement this feature (contributing guide)
Describe the user story
The terraform-aws-modules/lambda/aws module requires a python interpretter that matches the runtime so python3.8 interpretter for runtime python3.8, etc.
Describe the solution you'd like
Document installation of pyenv or similar to pin down runtime versions for python lambdas to use this common upstream module
Describe the drawbacks of your solution
N/A
Describe alternatives you've considered
N/A
I believe this should work. Some of the commands can be removed since the sh -l
or bash -l
is not supported by gosu
and so it will not run the .profile
file. Thus, we need to softlink into /usr/local/bin
for the binaries to be available to all users (root and atlantis).
RUN apk add --no-cache \
build-base \
libffi-dev \
openssl-dev \
bzip2-dev \
zlib-dev \
readline-dev \
sqlite-dev
RUN cd $HOME \
&& git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv \
&& cd $HOME/.pyenv \
&& git branch pyenv-2.3.27 v2.3.27 \
&& git checkout pyenv-2.3.27 \
&& cd $HOME \
&& git clone https://github.com/pyenv/pyenv-virtualenv.git $HOME/.pyenv/plugins/pyenv-virtualenv \
&& cd $HOME/.pyenv/plugins/pyenv-virtualenv \
&& git branch virtualenv-1.2.1 v1.2.1 \
&& git checkout virtualenv-1.2.1 \
&& cd $HOME \
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> $HOME/.profile \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> $HOME/.profile \
&& echo 'eval "$(pyenv init -)"' >> $HOME/.profile \
&& echo 'eval "$(pyenv virtualenv-init -)"' >> $HOME/.profile \
&& source $HOME/.profile \
&& pyenv install \
3.8.18 \
3.9.18 \
3.10.13 \
3.11.5 \
&& ln -sf $HOME/.pyenv/versions/3.8.18/bin/python3.8 /usr/local/bin/ \
&& ln -sf $HOME/.pyenv/versions/3.9.18/bin/python3.9 /usr/local/bin/ \
&& ln -sf $HOME/.pyenv/versions/3.10.13/bin/python3.10 /usr/local/bin/ \
&& ln -sf $HOME/.pyenv/versions/3.11.5/bin/python3.11 /usr/local/bin/