text: # AUTOGENERATED FILE
  FROM balenalib/apalis-imx6q-ubuntu:focal-run
  
  # remove several traces of debian python
  RUN apt-get purge -y python.*
  
  # http://bugs.python.org/issue19846
  # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
  ENV LANG C.UTF-8
  
  # install python dependencies
  RUN apt-get update && apt-get install -y --no-install-recommends \
  		ca-certificates \
  		netbase \
  	&& rm -rf /var/lib/apt/lists/*
  
  # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported
  # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported
  RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
  	&& gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
  	&& gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
  
  ENV PYTHON_VERSION 3.7.8
  
  # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
  ENV PYTHON_PIP_VERSION 20.1.1
  
  ENV SETUPTOOLS_VERSION 49.1.0
  
  RUN set -x \
  	&& buildDeps=' \
  		curl \
  	' \
  	&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
  	&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \
  	&& echo "d698c5962ad32b8bfe6d24624c26799859b6cdd5efa9ba69bb61ab0318411fae  Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" | sha256sum -c - \
  	&& tar -xzf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" --strip-components=1 \
  	&& rm -rf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \
  	&& ldconfig \
  	&& if [ ! -e /usr/local/bin/pip3 ]; then : \
  		&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
  		&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c  get-pip.py" | sha256sum -c - \
  		&& python3 get-pip.py \
  		&& rm get-pip.py \
  	; fi \
  	&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
  	&& find /usr/local \
  		\( -type d -a -name test -o -name tests \) \
  		-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
  		-exec rm -rf '{}' + \
  	&& cd / \
  	&& rm -rf /usr/src/python ~/.cache
  
  # make some useful symlinks that are expected to exist
  RUN cd /usr/local/bin \
  	&& ln -sf pip3 pip \
  	&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
  	&& ln -sf idle3 idle \
  	&& ln -sf pydoc3 pydoc \
  	&& ln -sf python3 python \
  	&& ln -sf python3-config python-config
  
  # set PYTHONPATH to point to dist-packages
  ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH
  
  CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
  
   RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \
    && echo "Running test-stack@python" \
    && chmod +x test-stack@python.sh \
    && bash test-stack@python.sh \
    && rm -rf test-stack@python.sh 
  
  RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu focal \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.7.8, Pip v20.1.1, Setuptools v49.1.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature  (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
  
  RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
  	&& chmod +x /bin/sh-shim \
  	&& cp /bin/sh /bin/sh.real \
  	&& mv /bin/sh-shim /bin/sh