Docker: disable setting time zones and keyboard

Share:
Docker: disable setting time zones and keyboard ## Disable time zones ```sh Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing the time zones in which they are located. 1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc 2. America 5. Arctic 8. Europe 11. SystemV 3. Antarctica 6. Asia 9. Indian 12. US Geographic area: ``` Solution ```sh # Setup timezone RUN echo 'Etc/UTC' > /etc/timezone && \ rm -f /etc/localtime && \ ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ apt-get update && apt-get install -y tzdata ``` ## Keyboard ```sh The layout of keyboards varies per country, with some countries having multiple common layouts. Please select the country of origin for the keyboard of this computer. 1. Afghani 2. Albanian 3. Amharic ... 99. Wolof Country of origin for the keyboard: ``` Solution: Add ``DEBIAN_FRONTEND=noninteractive`` ```sh COPY ./keyboard /etc/default/keyboard ``` Create a keyboard file: ```sh # KEYBOARD CONFIGURATION FILE # Consult the keyboard(5) manual page. XKBMODEL="pc105" XKBLAYOUT="us" XKBVARIANT="" XKBOPTIONS="" BACKSPACE="guess" ``` Copty this file to docker: ```sh COPY ./keyboard /etc/default/keyboard ``` cover

No comments