Docker安装Wine Dockerfile EULA

时间:2017-11-07 11:04:40

标签: shell docker dockerfile wine eula

在我的高山图像上安装Wine有点问题。 这是我的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;

一切似乎运作良好,但在 sudo apt-get install wine1.8 winetricks 期间我有这个EULA屏幕: EULA alert 当然,我没有权利写#34; YES"。我试过了:

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

我该怎么办?

1 个答案:

答案 0 :(得分:2)

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!