FROM alpine:3.15 RUN apk update && apk upgrade # This hack is widely applied to avoid python printing issues in docker containers. # See: https://github.com/Docker-Hub-frolvlad/docker-alpine-python3/pull/13 ENV PYTHONUNBUFFERED=1 RUN apk add --no-cache python2 && \ python -m ensurepip && \ rm -r /usr/lib/python*/ensurepip && \ pip install --upgrade pip setuptools && \ rm -r /root/.cache RUN pip install pyserial RUN mkdir -p /root ADD python_firmware /root/python_firmware/ WORKDIR /root/python_firmware CMD ["python2.7", "-u", "main.py"]