Unsatisfiable constraints when installing packages on docker alpine - docker

I'm build a docker image based on ruby:2.3-alpine. I need to install couple of packages for my rails application to run normally. Unfortunately the following packages does not exists on alpine repositories.
What's the way to install them?
$ uname -a
Linux 50642453afd5 4.1.17-boot2docker #1 SMP Thu Feb 11 08:12:31 UTC 2016 x86_64 Linux
$ apk add iceweasel
ERROR: unsatisfiable constraints:
iceweasel (missing):
required by: world[iceweasel]
Packages to install:
libav-tools
xfonts-base
xfonts-75dpi
iceweasel

As of June, 2016 "firefox-esr" replaces Iceweasel.
Here's how to install it in an Alpine Docker container, and to run it to verify it's installed correctly:
FROM ruby:2.3-alpine
RUN apk add --no-cache firefox-esr
RUN firefox --version
You'll probably also need a virtual display (framebuffer) like xvfb. See this for more info => https://github.com/rickypc/docker-python-firefox-xvfb/blob/master/Dockerfile

Related

alpine:3.14 docker libtls.so.20 conflict

So I am running into an error with the latest docker build from alpine. alpine:3.14.0 was released about a day ago and was trying to install libressl and libressl-dev and both seem to fail with the error below. My work around at the moment was to build using the alpine:3.12.0 as 3.12.0 seems to not have libretls installed. Although I would like to know how to fix this. I tried to remove libretls but that didn't work (error also below). Thanks
$ docker -v
Docker version 20.10.6, build 370c289
$ docker run --rm -it alpine /bin/ash
/ # apk add libressl-dev
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/5) Installing libressl3.3-libcrypto (3.3.3-r0)
(2/5) Installing libressl3.3-libssl (3.3.3-r0)
(3/5) Installing libressl3.3-libtls (3.3.3-r0)
ERROR: libressl3.3-libtls-3.3.3-r0: trying to overwrite usr/lib/libtls.so.20 owned by libretls-3.3.3-r0.
ERROR: libressl3.3-libtls-3.3.3-r0: trying to overwrite usr/lib/libtls.so.20.0.3 owned by libretls-3.3.3-r0.
(4/5) Installing pkgconf (1.7.4-r0)
(5/5) Installing libressl-dev (3.3.3-r0)
Executing busybox-1.33.1-r2.trigger
1 error; 41 MiB in 19 packages
/ #
/ # apk info libretls
libretls-3.3.3-r0 description:
port of libtls from libressl to openssl
libretls-3.3.3-r0 webpage:
https://git.causal.agency/libretls/
libretls-3.3.3-r0 installed size:
84 KiB
/ #
/ # apk del libretls
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/main: No such file or directory
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/community: No such file or directory
World updated, but the following packages are not removed due to:
libretls: busybox alpine-baselayout apk-tools
OK: 6 MiB in 14 packages
/ # exit
this is the upstream issue. Downgrading to alpine 3.13 works for now until the issue is fixed.
Normally docker images support fixed alpine versions (thanks to MrGlass comment). For example
python:3-alpine -> python:3-alpine3.13
php:7.4-fpm-alpine -> php:7.4-fpm-alpine3.13

How to fix 'Hash Sum Mismatch' in Docker Ubuntu 18.04 image

I'm trying to run docker container with ubuntu and nodejs to run some node application.
Firstly, I've searched for similar error of mine, and all didn't work for me.
For example, command below also have failed.
FROM ubuntu:18.04 as osbuild
RUN rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
apt-get -y update && \
This is not my first time to use this Dockerfile (I almostly reused it), but it fails and I'm so confused.
I'm guessing problem might be update on bionic-things in Ubuntu 18.04 (Just yesterday night... suspicious), or maybe it is problem of docker for mac, but I don't see any possible solution for this problem.
I'm using macOS 10.14.6 and Docker 19.03.4
My Dockerfile is
FROM ubuntu:18.04 as osbuild
RUN apt-get -y update && \
...
It failed with following error message:
Err:14 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
Hash Sum mismatch
...
Last modification reported: Sat, 09 Nov 2019 01:06:44 +0000
Release file created at: Sat, 09 Nov 2019 01:05:59 +0000
There was update on Ubuntu dist, including my problem dir.
Update was done at 2019-11-10 19:18, and now I can build docker image without error.

Installing docker-ce on Fedora 28

According to docker website, installation for Fedora should be as follow:
https://docs.docker.com/install/linux/docker-ce/fedora/#set-up-the-repository
However these instruction does not work for Fedora, and you get a frustrating message "Nothing to be done"
So how can I install Docker-ce on Fedora 28
From fedora 28 only the edge, test and nightly version are available.
To install docker-ce edge you can enable the edge repo:
dnf config-manager --set-disabled docker-ce-stable
dnf config-manager --set-enabled docker-ce-edge
dnf install docker-ce
At the writing of this answer, the repo of Docker did not contain a stable version for Fedora 28
The work around is to call:
sudo dnf install https://download.docker.com/linux/fedora/27/x86_64/stable/Packages/docker-ce-18.03.1.ce-1.fc27.x86_64.rpm
This will download the latest stable version at the writing of these lines.
Hope Docker will set a repo for Fedora 28 soon
I followed below steps on Fedora 28
Install DNF Plugins package
$ sudo dnf -y install dnf-plugins-core
--
Last metadata expiration check: 0:59:06 ago on Thu 05 Jul 2018 21:38:55 CDT.
Package dnf-plugins-core-2.1.5-4.fc28.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
Setup stable repository
$ sudo dnf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
--
Adding repo from: https://download.docker.com/linux/fedora/docker-ce.repo
Enable the edge and test repositories
$ sudo dnf config-manager --set-enabled docker-ce-edge
$ sudo dnf config-manager --set-enabled docker-ce-test
Install Docker CE
$ sudo dnf install docker-ce
....
Userid : "Docker Release (CE rpm) <docker#docker.com>"
Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
From : https://download.docker.com/linux/fedora/gpg
Start docker
$ sudo systemctl start docker
Verify installation
$ sudo docker run hello-world
If all goes well you should get
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
9bb5a5d4561a: Pull complete
Digest: sha256:3e1764d0f546ceac4565547df2ac4907fe46f007ea229fd7ef2718514bcec35d
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
installation for Fedora should be as follow
Fedora 28: A basic, simple way of getting docker-ce ...
cd /etc/yum.repos.d/
# dnf install https://download.docker.com/linux/fedora/docker-ce.repo
# dnf install docker-ce
You get version "18.03.1.ce.el7.centos" , I.e. the 'Enterprise' version.
EDIT : Also see the answer from #Sagi Forbes.

docker Error with pre-create check: "We support Virtualbox starting with version 5

I'm trying to create docker machine host using the following command in fedora OS version 25.
docker-machine create -driver=virtualbox host01
I get below error while executing the command.
Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is \"WARNING:
The vboxdrv kernel module is not loaded.
Either there is no module available for the current kernel (4.10.12-200.fc25.x86_64) or it failed to load.
Please try load the kernel module by executing as root
dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
You will not be able to start VMs until this problem is fixed.\\n5.1.26r117224\".
Please upgrade at https://www.virtualbox.org"
I have already virtualbox latest version installed. Running the command suggested by
sudo dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
I got the below error
Last metadata expiration check: 0:48:35 ago on Thu Aug 17 22:38:47 2017.
Package akmods-0.5.6-7.fc25.noarch is already installed, skipping.
No package --kernels available.
No package 4.10.12-200.fc25.x86_64 available.
Any suggestions?
I also had this problem and for this I upgrade Virtual box to 5.2 using following commands. This link help me
sudo apt-get remove virtualbox virtualbox-5.1
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-5.2
Hope this helps.
For windows users, in 2022 such problem still exists. So for those who use last build (now it is virtualBox-6.1.32-149290-Win), try to use version that starts with prefix 5. But not all '5' versions work. For example, for me worked only version 5.2.42 while versions: 5.2.18, 5.2.20, 5.2.44 didn't work
Helped for win 11 x64

Yum install / update not working inside docker images but working otherwise from the centos machine

I am able to yum install, or yum update from the server, but when trying to do same (as specified in the Dockerfile) inside a docker container, it fails stating the following common error :
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
my Docker file is a simple :
FROM centos:centos7
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf
RUN echo "nameserver 8.8.4.4" >> /etc/resolv.conf
RUN yum -y update; yum clean all
RUN yum -y install epel-release; yum clean all
RUN yum -y install python-pip; yum clean all
I have tried various things like adding ip_resolve=4 in /etc/yum.conf, or addinf 8.8.8.8 and 4.4.4.4 to /etc/resolv.conf and other methods, in vain.
here's the docker info :
Containers: 28
Running: 0
Paused: 0
Stopped: 28
Images: 144
Server Version: 1.13.0
docker-compose version 1.10.1, build b252738
docker-py version: 2.0.2
CPython version: 2.7.5
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
Please help. I am only running things under a VPN, no proxy.
machine is an AMI : 3.10.0-514.el7.x86_64.
Need I add it's IP anywhere insde docker container? Please help.
TIA!

Resources