Skip to content Skip to sidebar Skip to footer

Pip Install Of Aws-sam-cli Package With Python3.7 Version

In the below docker file: FROM alpine:latest ENV HOME /home/samcli ENV PATH $HOME/.local/bin:$PATH RUN mkdir /root/bin /aws; \ apk add --no-cache groff less bash python jq cu

Solution 1:

I would recommend using python offical image based on alpine so you will do not need to maintain and install the python version. Below base image is base on alpine 3.9 and python version is 3.7

FROM python:3.7-alpine3.9

ENV HOME /home/samcli
ENV PATH $HOME/.local/bin:$PATH
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
RUN apk add --no-cache --virtual .build-deps python2-dev  python3-dev gcc linux-headers musl-dev && \
    adduser samcli -Du 5566; \
    chown -R samcli $HOME;
RUN apk add --no-cache groff less bash jq curl py-pip tzdata
USER samcli

WORKDIR $HOME

RUN pip install --user --upgrade awscli aws-sam-cli;
USER root

RUN apk del .build-deps; \
    rm -rf /var/cache/apk/*

Post a Comment for "Pip Install Of Aws-sam-cli Package With Python3.7 Version"