Docker Python set utf-8 locale : <p>I am trying to run my python file that first reads a string in Chinese language and print it.</p>

<p>This is my Dockerfile</p>

<pre><code>FROM python:2.7-onbuild
ENV LANG en_US.UTF-8
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
CMD ["python", "app.py"]
</code></pre>

<p>This is my python file:</p>

<pre><code>    # -*- coding: utf-8 -*-
    import jieba
    s = "我来到北京清华大学"
    s = s.decode('utf-8')
    print type(s), s
</code></pre>

<p>I then run :</p>

<p><code>docker build -t python-example .</code></p>

<p><code>docker run python-example</code></p>

<p>Error i got: <code>UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)</code></p>

<p>When i run it locally, it works fine. </p>
