Getting error while installing package in docker image - azure

The beginning of this error is from creating and password based image in Azure environment. Below is the origin or this all. More info on this I just got to know we are using alpine based image.openjdk:8uX-alpine311
So I did googled a bit and found some package needs to be installed and to do that I need to execute below command.
RUN apt-get update; apt-get install -y fontconfig libfreetype6 which resulted me in
the command bin/sh sh returned a non zero code 127
After further analysis I found another solution to this is to run below query.
RUN apk add --update fontconfig libfreetype6 as result again came as
the command bin/sh sh returned a non zero code 2
I am wondering this is just some package installation on azure environment, what it takes every time change in command's. Any help appreciated, thanks in advance.

the command bin/sh sh returned a non zero code 127
Means the command wasn't found. Which is correct, since you're using an alpine image and apt-get is mostly found in debian based images. See also command '/bin/sh -c returned a non-zero code: 127
Testing your command on an local alpine:3.11 image I can verify that the command fails when trying to install libfreetype6
Try RUN apk add --update fontconfig freetype
You can verify if a package is available by checking pkgs.alpinelinux.org

Related

Cannot install package inside Dockerfile [E: Sub-process /usr/bin/dpkg returned an error code (1)]

I am trying to install a private package inside an Ubuntu 16.04 container. To do this, I am using the following line in a Dockerfile to build an image with base image Ubuntu 16.04 where nf is an argument set to various package names (repository addresses are not included):
FROM ubuntu:16.04
ENTRYPOINT ["/sbin/init"]
SHELL ["/bin/bash", "-c"]
ARG nf
RUN touch /etc/apt/sources.list.d/cinar.list
RUN echo -e $"<repository addresses are here>" >> /etc/apt/sources.list.d/cinar.list
RUN apt-get update
RUN apt-get install -y $nf
The last line results with the following error:
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/bash -c apt-get install -y $nf' returned a non-zero code: 100
However, when I remove this line from the Dockerfile and build the image, then go inside the container and use the command apt-get install -y packagename, this error does not occur. I would appreciate any help on this issue since I am doing an automation task and cannot manually install packages on containers. I have tried the solutions listed here, and none of them seems to work.
In bash, $"repository-addresses" is exactly the same as repository-addresses.
repository-addresses is not valid for entries in /etc/apt/sources.list.d/*.list, nor is it a valid variable name.
If you have repository-addresses as build-arg, you should rename it to repository_addresses and use it with :
ARG repository_addresses
...
RUN echo -e "$repository_addresses" >> /etc/apt/sources.list.d/cinar.list

How to install and run Tacotron2 on Ubuntu WSL?

I am running Ubuntu 20.04 on WSL Windows 10 Pro 2004 (19041.388), and I am very much wanting to run Tacotron2 and try out the functionality. I have installed Tacotron2 from git via command-line, but I'm uncertain whether it built successfully. I am a beginner with Linux and Docker, and the install instructions from above-linked Tacotron2 seems confusing.
So here is where I am at:
Installed Docker, confirmed up and running, all good.
Downloaded Tacotron2 via git cmd-line - success.
Executed this command: sudo docker build -t tacotron-2_image -f docker/Dockerfile docker/ - a lot of stuff happened that seemed successful, but at the end, there was an error:
Package libav-tools is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it:
ffmpeg
E: Package 'libav-tools' has no installation candidate The command '/bin/bash -c apt-get install -y libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools wget git vim'
returned a non-zero code: 100
At this point I am stuck. It's true that I'm looking to get unstuck on this error, but comprehensively I'm looking for exact steps to be able to run Tacotron2 and ultimately be able to feed it an mp3 file with someone's voice, and then be able to feed it some text, which it will then "speak" in that voice.
That is my understanding of what Tacotron2 is, but I am keen to know if I am going down the wrong path.
Your issue looks quite similar to https://github.com/Rayhane-mamah/Tacotron-2/issues/475
The issue happens because you have libav-tools installation directives in your Dockerfile which is no longer has installation candidates.
To eliminate the error you need to open docker/Dockerfile in any text editor and remove libav-tools from the line that contains
apt-get install -y libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools wget git vim
to have something like
apt-get install -y libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg wget git vim
Since package ffmpeg already in this list you don't need to add it again.
You can also remove libav-tools from the Dockerfile using sed command in the WSL shell (might need to add sudo before sed if you have error with permissions):
sed -i docker/Dockerfile -e 's/libav-tools\ //g'
Then your build command should pass.

Facebook Duckling error getDirectoryContents:openDirStream: does not exist

i followed the following steps:
apt-get install haskell-platform
curl -sSL https://get.haskellstack.org/ | sh
git clone https://github.com/facebookincubator/duckling.git
stack setup
stack build
stack exec duckling-example-exe
and i get the following error any idea why?
duckling-example-exe: /usr/share/zoneinfo/: getDirectoryContents:openDirStream: does not exist (No such file or directory)
You might just need to apt-get install tzdata -- I was searching for where zoneinfo is supposed to come from, and I found reports that it was not installed by default anymore in Ubuntu 16.04. I don't see that it's a part of baseimage at all, so it's probably missing from your container.
from source

How does one get docker running on Ubuntu 16 and remove old installs?

I had taken a course on a training site that first suggested using sudo apt-get install docker.io or docker-io. The instructor then explained that this is an old method. So, then, without mentioning removing that version, he says to add a repo and use sudo apt-get update followed by sudo apt-get install docker lxc-docker. I saw the errors when I tried to see if it was running after this and to pull an image, not in that order - I mean I wouldn't try to pull if it wasn't running.
Anyway, I cannot seem to get it to start. I got this error instead
Job for docker.service failed because the control process exited with error code. I setup a full gist to show the complete output.
First I should note, that I do have docker installed in /usr/bin/docker and while I don't see a lxc-docker there are files in there that seem to relate to docker and start with lxc.
The gist is at: https://gist.github.com/BruceMWhealton/0c6b84062b013d500089c5e22bf10462
Any advice would be greatly appreciated.
Thanks,
Bruce
The installation on Ubuntu docs have steps for this. Basically, add the current apt source:
deb https://apt.dockerproject.org/repo ubuntu-xenial main
Then update the cache and remove the old package:
sudo apt-get upgrade
sudo apt-get purge lxc-docker
Then you should be able to install the latest version - check with docker version and it will be (as of today) 1.12.1.

Docker upgrades failing due to conflicts

I am attempting to upgrade Docker on CentOS 7 from 1.9 to 1.10. I am using the script provided on the Docker website:
https://docs.docker.com/engine/installation/linux/centos/
I am running the script:
curl -fsSL https://get.docker.com/ | sh
Eventually, the script executes the following command:
sudo -E sh -c 'sleep 3; yum -y -q install docker-engine'
This command is failing with the following message:
Error: docker-engine-selinux conflicts with docker-selinux-1.9.1-25.el7.centos.x86_64
Error: docker-engine conflicts with docker-1.9.1-25.el7.centos.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I have isolated this failure to the yum command, and attempted to run it using the --skip-broken. This doesn't do much, though:
$ sudo yum -y -q --skip-broken install docker-engine
Packages skipped because of dependency problems:
docker-engine-1.10.3-1.el7.centos.x86_64 from docker-main-repo
docker-engine-selinux-1.10.3-1.el7.centos.noarch from docker-main-repo
Trying the rpm command does nothing. Running the referenced rpm command seems to do something, but whatever it does it has no effect on the install. The failure persists.
Internet searches have revealed that others have seen similar problems, but usually their problems come because some dependency, referenced in the failure, was missing. There don't appear to be any missing dependencies on my system.
I even tried removing version 1.9. That does not change anything either.
Following the instructions for a manual install provided on the docker site hasn't changed anything, either.
There is also nothing in the Docker documentation that describes this particular problem.
Has anyone seen this exact problem before? Does anyone know some way to fix it???
Please advise.
From this message:
docker-engine-selinux conflicts with docker-selinux
I suspect you previously had the Red Hat distributed version of Docker installed, which installs docker-selinux. The official Docker packages also install a similar package (docker-engine-selinux) and that conflicts with the package you already have installed.
The best approach would be to uninstall the existing docker version (including the docker-selinux package), and then install docker-engine, following the instructions in the documentation; https://docs.docker.com/engine/installation/linux/centos/

Resources