I am learning how to make a utility image which can accept python commands
-
FROM alpine:3.8
-
-
RUN apk add --no-cache curl python python3 gcc python3-dev linux-headers build-base libffi-dev && \
-
python3 -m ensurepip && \
-
rm -r /usr/lib/python*/ensurepip && \
-
pip3 install --upgrade pip setuptools && \
-
pip3 install requests && \
-
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
-
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
-
rm -r /root/.cache
-
-
-
#Features to add
-
# Connect test endpoint to new container
-
# If main service dosen't exist create it
-
# Add new container as upstream to main service
-
# Move main service so it is 100% pointing at new service
-
-
-
ENTRYPOINT ["/usr/bin/python3"]
docker build . -t metcarob/tmp_image:localbuild
Interactive run
docker run -it metcarob/tmp_image:localbuild
Command line input
printf "print('aa')\nprint('bb')\n" | docker run -i metcarob/tmp_image:localbuild
RJM Article Type
Work Notes