shelldockerdockerfilewineeula

Docker Install Wine Dockerfile EULA


I have a little problem to install Wine on my alpine image. Here is my Dockerfile :

RUN dpkg --add-architecture i386 && sudo apt-get update
RUN sudo apt-get install software-properties-common python-software-properties

RUN sudo add-apt-repository ppa:ubuntu-wine/ppa
RUN sudo apt-get update
RUN sudo apt-get install wine1.8 winetricks

RUN sudo apt-get purge software-properties-common python-software-properties

RUN rm -rf /tmp/* /var/lib/apt/lists/* /root/.cache/*

CMD /bin/bash;

All seems to work well, but during the sudo apt-get install wine1.8 winetricks I have this EULA screen : EULA alert Of course I don't have the right to write "YES". I tried :

RUN echo "yes" | sudo apt-get install wine1.8 winetricks
RUN sudo apt-get -y install wine1.8 winetricks

What can I do ?


Solution

  • Note: In the interest of edification, I would love it if a more learned linux/docker user could explain the mechanics behind why my solution worked for me.

    Possible Solution: I encountered this exact problem. I must have tried every conceivable way to pass an argument via my Dockerfile that would accept the EULA; to include piping an echo of "yes" to the wine installation command, as you've tried, setting environment variables and so-on. So, you're not alone here. I did, however, find a very simple solution through experimentation.

    It turns out that if you install the TrueType core fonts (the package the EULA is for) before installing wine, you can pass it the "yes" input like so and wine will never prompt for the EULA:

    RUN echo "yes" | apt install ttf-mscorefonts-installer -y
    

    I'm not sure why this is. I suspect that it's because installing wine installs several other packages/dependencies in the process, and the echo/pipe approach does not extend to all packages that wine attempts to install. Perhaps by installing the fonts separately, the wine installation script either disregards the package because it's already present, or some file within the font installation logs the EULA acceptance response.

    Here's the contents of my Dockerfile. I'm on Ubuntu 16.04 LTS, using Docker version 18.02.0-ce, build fc4de44:

    FROM ubuntu:16.04
    RUN dpkg --add-architecture i386
    RUN apt-get update -y
    RUN echo "yes" | apt install ttf-mscorefonts-installer -y
    RUN apt-get install wine -y
    

    I see it's four months since this post was made, but if you haven't found a solution, I hope this helps!