What is Dockerfile encoding?

My definition Dockerfile

I got this line:

...
MAINTAINER Ramón <ramon@example.com>
...

      

What encoding should I use to save this file?

Can I escape non-ASCII characters?

+3


source to share


2 answers


Considering Docker runs in Go , and Go has native utf-8 support , it is better to keep the Dockerfile directly encoded in UTF-8.

This way all characters (ASCII or not) are supported.

See " Working with Encodings in Go ".

While Go has good UTF-8 support (and minimal UTF-16 support), it doesn't have built-in support for any other encoding.
If you need to use other encodings (for example, when dealing with user input), you must use third-party packages like go-charset .



It is best here if the Dockerfile is directly encoded to UTF-8.


July 2016 update, docker 1.12-rc5 adds:

  • PR 23372 : support for unicode characters in parseWords
  • PR 23234 : Skip UTF-8 BOM bytes from Dockerfile and .dockerignore if they exist
+3


source


You need to set the locale correctly, remove the accent, check the encoding with the base docker run -it container env

one and then put the correct encoding, "Bible" on it http://jaredmarkell.com/docker-and-locales/



-1


source







All Articles