I have this blubber file for Wikilabels (source)
version: v3 base: docker-registry.wikimedia.org/wikimedia-stretch:latest apt: packages: [postgresql-server-dev-all, postgresql, libffi-dev, g++, python3-dev, libmemcached-dev, python3-setuptools, ca-certificates, libz-dev] python: version: python3.5 lives: in: /srv/service runs: environment: PYTHONUTF8: 1 PYTHONIOENCODING: utf-8 variants: build: python: requirements: [requirements.txt] development: includes: [build] entrypoint: [./utility, dev_server] test: includes: [build] python: requirements: [requirements.txt, requirements-test.txt] runs: insecurely: true entrypoint: ["pytest", "-vvv", "--cov=wikilabels", "-m 'not nottravis'"] prep: includes: [build] node: env: production production: base: debian:stretch-slim node: env: production copies: prep entrypoint: [node, server.js]
After building the docker file and running test, it always fail with UnicodeError and uses ascii as the default encoding. This is the docker file:
FROM docker-registry.wikimedia.org/wikimedia-stretch:latest USER "root" ENV HOME="/root" ENV DEBIAN_FRONTEND="noninteractive" RUN apt-get update && apt-get install -y "postgresql-server-dev-all" "postgresql" "libffi-dev" "g++" "python3-dev" "libmemcached-dev" "python3-setuptools" "ca-certificates" "libz-dev" && rm -rf /var/lib/apt/lists/* RUN python3.5 "-m" "easy_install" "pip" && python3.5 "-m" "pip" "install" "-U" "setuptools" "wheel" "tox" RUN groupadd -o -g "65533" -r "somebody" && useradd -o -m -d "/home/somebody" -r -g "somebody" -u "65533" "somebody" && mkdir -p "/srv/service" && chown "65533":"65533" "/srv/service" && mkdir -p "/opt/lib" && chown "65533":"65533" "/opt/lib" RUN groupadd -o -g "900" -r "runuser" && useradd -o -m -d "/home/runuser" -r -g "runuser" -u "900" "runuser" USER "somebody" ENV HOME="/home/somebody" WORKDIR "/srv/service" ENV PYTHONIOENCODING="utf-8" PYTHONUTF8="1" ENV PIP_FIND_LINKS="file:///opt/lib/python" PIP_WHEEL_DIR="/opt/lib/python" RUN mkdir -p "/opt/lib/python" COPY --chown=65533:65533 ["requirements.txt", "requirements-test.txt", "./"] RUN python3.5 "-m" "pip" "wheel" "-r" "requirements.txt" "-r" "requirements-test.txt" && python3.5 "-m" "pip" "install" "--target" "/opt/lib/python/site-packages" "-r" "requirements.txt" "-r" "requirements-test.txt" COPY --chown=65533:65533 [".", "."] ENV PATH="/opt/lib/python/site-packages/bin:${PATH}" PIP_NO_INDEX="1" PYTHONPATH="/opt/lib/python/site-packages" ENTRYPOINT ["pytest", "-vvv", "--cov=wikilabels", "-m 'not nottravis'"] LABEL blubber.variant="test" blubber.version="0.4.0+882f0fc"
I'm enforcing UTF-8 as much as possible but still I get something like this:
wikilabels/tests/test_auth_routes.py:1: in <module> from .routes_test_fixture import app # noqa wikilabels/tests/routes_test_fixture.py:6: in <module> from ..wsgi import server wikilabels/wsgi/server.py:10: in <module> from . import assets, routes, sessions wikilabels/wsgi/routes/__init__.py:7: in <module> from . import form_builder wikilabels/wsgi/routes/form_builder.py:5: in <module> from ..util import build_script_tags, build_style_tags, static_file_path wikilabels/wsgi/util.py:13: in <module> from ..i18n import i18n wikilabels/i18n/__init__.py:12: in <module> MESSAGES[lang_code] = json.load(open(file_loc)) /usr/lib/python3.5/json/__init__.py:265: in load return loads(fp.read(), /usr/lib/python3.5/encodings/ascii.py:26: in decode return codecs.ascii_decode(input, self.errors)[0] E UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 105: ordinal not in range(128)
I added installing locales package but didn't work either.
One hint is that if I change the base from wikimedia stretch to the dockerhub stretch, it fails for another reason.