Docker Install Wine Dockerfile EULA - shell

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 :
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 ?

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!

Related

Shell driver install with `ACCEPT_EULA=Y` error

As described here, I am trying to install the following driver in shell, using this code (modified from the original slightly):
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/debian/8/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
But I get an error on the last command:
sudo: sorry, you are not allowed to set the following environment variables: ACCEPT_EULA
After searching, I can't seem to find this exact error anywhere else.
One solution is to run the last command without ACCEPT_EULA=Y as sudo apt-get install msodbcsql17. And then to enter Y at the prompt. This indeed works but I would like to run the above installation for other users without need of their input.
Is there a way to resolve the above error so I can use ACCEPT_EULA=Y, or
alternatively is there a simple way to enter the Y response for the EULA
automatically so the end user never needs to take any action?
Thank you in advance.
You appear to have access to run arbitrary commands, but not to modify the environment.
The simple workaround is to hand off environment changes to the command:
sudo env ACCEPT_EULA=Y apt-get install msodbcsql17
I don't have enough rep to post a comment.
But I was doing the same install for pyodbc inside a python:3 docker container.
In the dockerfile the following command works:
ACCEPT_EULA=Y apt-get install -y msodbcsql17
(I was after this particular driver #17.)
Reading: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/pyodbc/Dockerfile can help see the environment set up from a base ubuntu (ubuntu:16.04) box.
Also check up on: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017
for microsoft first hand docs.
The ACCEPT_EULA=Y apt-get install -y msodbcsql17 command above did the trick for me as I was trying to set up msodbcsql17 via a Dockerfile.

`docker build` fails trying to install ubuntu packages

Trying to build a simple ubuntu apache web server docker image, I get an error while the docker build command tries installing packages. I am using the Ubuntu base image in Docker to do this. Below is the code in my Dockerfile;
FROM ubuntu
RUN apt-get update
RUN apt-get install apache2
RUN apt-get install apache2-utils
RUN apt-get clean
EXPOSE 80
CMD ["apache2ctl", "-D", "FOREGROUND"]
My Host OS is Mac OSX El Capitan, and the error I get when the build fails is;
The command '/bin/sh -c apt-get install apache2' returned a non-zero code: 1
and my docker build command is;
docker build -t="webserver" .
Any help please. Thanks in Advance.
You should use the '-y' apt-get flag when building an image.
apt-get will ask you permission to continue with apache installation, and since you can't interact with the apt-get while building the image, you must pass the '-y' flag that means 'yes' to apt-get prompt.
Try changing it to:
FROM ubuntu
RUN apt-get update
RUN apt-get install apache2 -y
RUN apt-get install apache2-utils -y
RUN apt-get clean
EXPOSE 80
CMD ["apache2ctl", "-D", "FOREGROUND"]
or even:
FROM ubuntu
RUN apt-get update && apt-get install apache2 apache2-utils -y
RUN apt-get clean
EXPOSE 80
CMD ["apache2ctl", "-D", "FOREGROUND"]

WARNING: erroneous pipeline: no element "x264enc"

I have been trying to get this running for the past couple of days now. I have a gstreamer command that requires x264enc. I am running a Mac I cannot seem to get x264 development libraries installed. I have installed gst-plugins-bad but that does not help. I read in forums I need to install x264 libraries first before installing gst-plugins-bad
I also tried VideoLAN's http://www.videolan.org/developers/x264.html That did not help either. I don't know what I'm missing. If it was Linux I could install the x264-devel packages. But I can't seem to find an alternative to that on Mac El Capitan.
The error I get is:
WARNING: erroneous pipeline: no element "x264enc"
Please help.
Try:
brew install gst-plugins-ugly --with-x264
x264enc is in gst-plugins-ugly, have you installed that? Homebrew is a popular package manager for macOS, installing gstreamer and x264 using that may be helpful also.
Build all module of GStreamer in follows sequence:
(1) Gstreamer-1.0
(2) gst-libav-1.8.3
(3) gst-plugins-base-1.8.3
(4) gst-plugins-good-1.8.3
(5) gst-plugins-bad-1.8.3
(6) gst-plugins-ugly-1.8.3
Set below path :
export PATH=$PATH:<install_dir_path>/bin
export LD_LIBRARY_PATH=<install_dir_path>/lib
export GST_PLUGIN_PATH=<install_dir_path>/lib/gstreamer-1.0
# building gst-plugins-ugly
export version=1.14.5
echo "building gst-plugins-ugly-$version"
cd $PROJECT_DIR/gst-plugins-ugly-$version
./autogen.sh
./configure --with-x264-libraries=/usr/lib/x86_64-linux-gnu/libx264.so
make -j8
sudo make install
Shot answer
For me, it started working after I installed ugly package. I use Ubuntu, my install command is:
sudo apt install -y gstreamer1.0-plugins-ugly
Similar case with solution
I had the similar issue with Ubuntu 22.04. But my first missing package was qtdemux. Originally I followed #brendan-shanks's answer (it worked) and on another machine tried #pooja's answer.
My command looks like this:
gst-launch-1.0 -v filesrc location="/home/ubuntu/countdown_10_min.mp4" ! qtdemux ! video/x-h264 ! rtph264pay ! udpsink host=127.0.0.1 port=8004
Following #pooja's solution I'v run several commands before it started working:
sudo apt install -y gstreamer1.0-plugins-base
sudo apt install -y gstreamer1.0-libav
sudo apt install -y gstreamer1.0-plugins-ugly
sudo apt install -y gstreamer1.0-plugins-bad
I don't know if qtdemux is in plugins-bad but only after that I was able to run my stream.
So, in similar case I would check packages #pooja have mentioned. For Ubuntu they are:
sudo apt install -y gstreamer1.0-tools
sudo apt install -y gstreamer1.0-libav
sudo apt install -y gstreamer1.0-plugins-base
sudo apt install -y gstreamer1.0-plugins-good
sudo apt install -y gstreamer1.0-plugins-bad
sudo apt install -y gstreamer1.0-plugins-ugly

How to make a script with apt-get commands?

I'm doing a script which installs a tcl plugin.
But this tcl plugin require some additional tcl/tk libraries, so I was thinking about putting an APT-GET install command for installing these libraries.
Is there a way to use the APT-GET install command in a script (it can be Shell script, Perl or even Tcl)?
This is an example of how to do it with one line and assumes you are running the script with sudo or have appropriate privilege.
apt-get -qq update && apt-get -qq --yes --force-yes install tcl
-qq suppresses output unless an error occurs
--yes answers the prompt 'Do you want to continue? [Y/n]'
--force-yes installs packages that come from a private repository
Consider running apt-get update & earlier in the script. Check or wait for the job to finish before using apt-get install
You can list multiple packages on one line. Packages are installed in the order they are listed.

how to install apt-get, raspbian

I am doing host target development within scratchbox. And apt-get is not installed in my target raspbian rootfile system.
What is the right apt-get package to use from here for raspbian ?
http://www.apt-get.org/main/
Should i use wget command for .deb package of apt-get ?
http://www.cyberciti.biz/tips/linux-wget-your-ultimate-command-line-downloader.html
http://www.thegeekstuff.com/2009/09/the-ultimate-wget-download-guide-with-15-awesome-examples/#more-1885
dpkg is installed in root filesystem of my target, i have checked it using whereis command
Please suggest, or can you suggest some link for installing apt-get itself. I am not able to find something related to it.
Any reply will be appreciable.
Looks like maybe debian apt package will get you there. I thought apt was just ubuntu but no.
The Raspbian FAQ is here: http://www.raspbian.org/RaspbianFAQ
In it you can grab a list of apps included in Rasbian:
http://archive.raspbian.org/raspbian/dists/wheezy/main/binary-armhf/Packages
You can grab the Raspbian package archive here:
http://archive.raspbian.org/raspbian/dists/wheezy/main/binary-armhf/Packages.gz
Extract it, then use dpkg to install apt-get.
Install Putty.exe and login with putty to your raspbian with ip-adress of your raspbian and you can install apt-get!
Install the following:
sudo apt-get update;
sudo apt-get install gcc;
sudo apt-get install autoconf;
sudo apt-get install libtool;
sudo apt-get install pkg-config;
sudo apt-get install libselinux1-dev;
sudo apt-get install liblockdev1-dev;
sudo apt-get install gawk;
sudo apt-get install g++;
sudo apt-get install c++;
sudo apt-get install libgudev-1.0-dev;
sudo apt-get install libudev-dev;
mkdir -p $HOME/distr/libcec;
wget -P $HOME/distr/libcec https://github.com/Pulse-Eight/libcec/archive/master.zip;
unzip $HOME/distr/libcec/master.zip -d $HOME/distr/libcec/;
cd $HOME/distr/libcec/libcec-master ./bootstrap;"
./configure --with-rpi-include-path=/opt/vc/include --with-rpi-lib-path=/opt/vc/lib --enable-rpi;
make;
sudo make install;
sudo apt-get install cec-utils;
sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update
sudo reboot
After the reboot, is everything up-to-date and you have no problems anymore!

Resources