What is the docker daemon version on Vagrant provisioner? - docker

I am trying to understand which is the version that Vagrant installs on its VM (my specific case: using box ubuntu/trusty64) if a Docker provisioner is selected.
In particular, I would like it to be a fixed version since it has to reflect my staging environment.
Unfortunately, in the documentation of the provisioner nothing is mentioned about which version of the Docker daemon will be installed. Same by searching for my question, either on google or on github issues.
Can somebody point me to the right directions/docs?

Basically vagrant will try to install the latest version available from the repo. You can review in the source code
machine.communicate.tap do |comm|
comm.sudo("apt-get update -qq -y")
comm.sudo("apt-get install -qq -y --force-yes curl apt-transport-https")
comm.sudo("apt-get purge -qq -y lxc-docker* || true")
comm.sudo("curl -sSL https://get.docker.com/ | sh")
end
If you prefer to have a specific version installed you would need to run a shell provisioner before your docker provisioner (provisioner are run in order) and install the version you want to work with

Related

How do I install erlang OTP 25 on ubuntu?

I am trying to install erlang 25 (and elixir 1.13) on my ubuntu VM, but the default version installed by apt is erlang 24.
I've tried both :
sudo wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.d
sudo apt update
and
sudo wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && sudo dpkg -i erlang-solutions_2.0_all.d
sudo apt update
but in both case, running apt-cache policy esl-erlang didn't show the desired version. I have recently installed erlang 25 on a identical vm, and I don't remember struggling at all, so I'm guessing there's a simple way of doing it that I just forgot ?
I hope you can help me, thank you !
From the Erlang OTP repo, you should do:
apt-get install erlang
If you decide to compile from source:
git clone https://github.com/erlang/otp.git
cd otp
git checkout maint-25 # current latest stable version
./configure
make
make install
Alternatively, you can use Kerl:
curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
chmod a+x kerl
and place kerl in your PATH so that you can invoke it from the terminal (remember to source your .bashrc or similar if you update your PATH variable there, or open a new terminal to reload the PATH env), i.e.,
export PATH=<path-to-kerl>:$PATH
Instructions on how to use it here.
I would recommend the usage of the Erlang Version Manager, thanks to which you can compile and install any Erlang OTP version you need, regardless of what the default version is currently available for your Linux distro.
Installation of Erlang Version Manager:
$ git clone https://github.com/robisonsantos/evm /tmp/evm/
$ cd /tmp/evm/
$ /tmp/evm/install
$ echo 'source ~/.evm/scripts/evm' >> ~/.bashrc
$ bash
Installation of the specific Erlang OTP version:
$ evm install 25.1.1 -y
$ evm default 25.1.1

Install valgrind on ubi8-minimal docker image

I want to install valgrind on a docker container based on ubi-8 minimal image. The problem is the tool doesn't seem to be available in any packages on the microdnf repository. I tried with gcc-toolset-11-valgrind, gcc-toolset-11-gcc-11, gcc-toolset-11-gcc-c++, gcc-toolset-11-runtime, etc to see if the tool is available in any package. There should be a package available for normal rpm: gcc-toolset-11-perftools, but it isn't available.
I also tried to download valgrind by hand and execute from a volume but the dependencies are not available. Is there a easier way to get running valgrind on a ubi8-minimal docker container?
Using rpm in combination with already download packages I finally managed to install valgrind, the process was:
download valgrind package and dependencies with yum in the host machine
yum install --downloadonly --downloaddir=./valgrindDownload gcc-toolset-11-valgrind
Find out missing dependencies (gcc-toolset-11-runtime-11, and perl)
Install local packages using rpm:
rpm --install ./valgrindDownload/gcc-toolset-11-valgrind-3.17.0-6.el8.x86_64.rpm
Find out valgrind instalation directory
In my case was under /opt/rh/gcc-toolset-11/root/usr/bin/valgrind
Finally run the full command:
sudo docker run -v `pwd`:/home/<container-dir> <docker-image>:<version> /bin/bash -c "microdnf install gcc-toolset-11-runtime-11.1-1.el8.x86_64 && microdnf install perl-5.26.3-421.el8.x86_64 && rpm --install ./valgrindDownload/gcc-toolset-11-valgrind-3.17.0-6.el8.x86_64.rpm && /opt/rh/gcc-toolset-11/root/usr/bin/valgrind --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt command <arguments>"
Doing so, the valgrind output gets redirected to valgrind-out.txt

Docker: Openjdk:14 RHEL based imaged, cannot install yum/wget/netstat

In my dockerfile, I need a maven builder (3.6 at least) working on a OpenJDK (J14 is required).
FROM maven:3.6.3-openjdk-14 as builder
The problem is simple: I need netstat command because it is used in several scripts. The OpenJDK official image is RHEL based, so it comes without any of this package installed.
I tried to download it or yum via wget command but, as you can guess, it is not installed. I feel trapped because it seems like you cannot you can't install any package on it.
That image is actually based on Oracle
$ podman run -it maven:3.6.3-openjdk-14 /bin/bash -c 'cat /etc/os-release'
NAME="Oracle Linux Server"
VERSION="8.2"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.2"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.2"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:2:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.2
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.2
And this is actually a "slim" variant where dnf or yum aren't installed, but microdnf is. Try using that, instead:
RUN microdnf install /usr/bin/netstat
Or
RUN microdnf install net-tools

WSL: Can't install docker on WSL 2, Ubuntu 18.04

I've searched lots of related posts on here and other site but anything didn't solve my problem.
As mentioned on title I'm struggling to install docker on linux subsystem on window OS
I'm with win 10 home edition so I've already installed Docker tool box, and my wsl is version 2 with Ubuntu 18.04
I was following the instructions and everything was fine until I did:
~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
Is there anyone who had same difficulty but solved this problem?
Thank you in advance!
The issue is because of a real-time clock issue with the Glibc library under the WSL v1 setup. WSL v2 may fix this under the hood and you may not run into the issue in future.
Now you can fix Glibc manualy:
$ sudo add-apt-repository ppa:rafaeldtinoco/lp1871129
$ sudo apt update
$ sudo apt install libc6=2.31-0ubuntu8+lp1871129~1 -y
$ sudo apt-mark hold libc6
//Remove "-y" if needed on above step #3.
//And when asked, give "y" and hit enter.
The above set of commands will add the latest version of the Glibc library and put the stable library on hold, until needed to reenable.
You can track this issue https://github.com/microsoft/WSL/issues/5125

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