How to install docker version 1.13.1 on Ubuntu 14.04 - docker

I have Ubuntu 14.04 machine with me and I want to install Docker engine version 1.13.1. I want this version because I want to try docker compose and swarms.
In one of my other machine, I have 1.12.3 available which do not support 'docker stack'. I checked following link for install.
https://docs.docker.com/cs-engine/1.13/#install-on-ubuntu-1404-lts-or-1604-lts
I was able to execute till step number 3. When I check the option to install specifically version 1.13.1 or 1.13.0, it gives me error that no such package is available.
$ sudo apt-get install docker-ce=1.13.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce
$ sudo apt-cache madison docker-engine
N: Unable to locate package docker-engine
Please help me install 1.13.1.
Thank you.

Section install from repositories doesn't work well. It seem that version 1.13.xx is not in the repos.
Issue
apt-get remove docker-engine
and then follow section use packages
basically it says to download package from packages-list and then e.g. sudo dpkg -i docker-engine_1.13.1_cs8-0_ubuntu-xenial_amd64.deb

Related

Unable to locate package buildah

I am trying to build Ubuntu image with a possibility to build Docker images on it. The tool that I want to use for it is buildah. However when my docker build executes the installation command: sudo apt-get -y install buildah I get this error: Unable to locate package buildah. My base image is: Zulu OpenJDK from Azul. I can clearly see that the requested package is in the central Ubuntu repo so I really do not understand why it can not find it.
The problem is that the Zulu Dockerfile that you are using is based on Debian Buster (10.0), not Ubuntu. This is indicated by the first line of the file:
FROM debian:buster-slim
Looking at the buildah installation instructions on Github (https://github.com/containers/buildah/blob/master/install.md), we find that buildah is only available in the Bullseye testing branch for Debian not from the default package repo.
Edit your /etc/apt/sources.list file and append the following line:
deb http://deb.debian.org/debian testing main contrib non-free
Run sudo apt update and then you can install buildah using sudo apt-get install buildah

apt install in Dockefile

I have a docker file with image which contain Debian.
because of vulnerabilities I tried to change version of open ssl in dockerfile.
the current used version 1.1.0j-1~deb9u1 im tried to install different version using:
RUN apt-get install openssl=1.1.0l-1~deb9u1
but I keep getting -
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.1.0l-1~deb9u1' for 'openssl' was not found
what should I do to enable installation of different stable version.
Given your selection of the package version and based on the information from the debian package repository, I assume that your debian version is stretch. The following dockerfile worked for me:
FROM debian:stretch
RUN apt-get update
RUN apt-get install -y openssl=1.1.0l-1~deb9u1
After docker build -t debian-openssl .the installed openssl version can be verified like this:
$ docker run -t debian-openssl openssl version
OpenSSL 1.1.0l 10 Sep 2019

Docker : What packages should I apt-mark hold to keep a specific docker version?

I want that all Linux Ubuntu servers I work with use the same docker version. I also want that if I run an apt-get upgrade command the docker related packages stay on this version and don't auto upgrade.
The first part was easy, it was explained in the official docker doc. For the second part I used apt-mark hold docker-ce after installing the specific docker version.
But after an apt-get upgrade a few weeks later I noticed that the containerd.io version shown by the docker version command was different than before.
I am not sure if this has any consequences. So my question is what packages, if any, should I apt-mark hold besides docker-ce?
docker-ce-cli? containerd.io? runc?
Or should I only hold docker-ce and let the other packages do their upgrades?

Why can't Docker find a existing package?

I am new at using Docker so this may be obvious for some. I am running Ubuntu 18.04TLS.
I want to install the package "python3-protobuf" inside an image. I try to do this with the following line in the Dockerfile:
...
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-protobuf \
<some other packages to be installed>
...
When I run 'docker build -t myImageName', I get the message:
E: Unable to locate package python3-protobuf
There are many packages that I am installing but this is the only one that is creating a problem for me.
I know that the package name is correct because in the terminal, when I 'apt search' for it, it is found. Additionally, in the dockerfile I do the recommended 'update' and 'install' steps. So it should be finding it. Any ideas why it does not?
#banuj answered this question.
The package "python3-protobuf" became available from Ubuntu 18.04 and onward. The base image I took is using ubuntu 16.04.
I have two way to solve this:
Use a base image that is with ubuntu 18.04 (or later)
Use pip to install the package.
I ended up using option two.

How to install docker-ce without internet and intranet yum repository?

I downloaded the RPM package from the official website, but I still need to download some dependencies when I install it. I need to install docker-ce without any network or repository at all, so I need all the RPM packages I depend on and the order in which they are installed.
Docker-CE Version: 18.03+
Only way to install if there is no internet is download tar and extract.
Steps available at :- Docker Install Steps
tar can be downloaded from
Binary repo
if you don't want to install the binary file and thus configure it from scratch Docker, you can download all the RPM packages needed for your system, upload them to your offline machine, and install them.
Suppose you are on Centos 7.7, spin up a docker centos container, find all the needed dependencies. Download them. Upload and install them.
# In an online machine
docker run --rm -v ${PWD}/bin:/tmp -it centos:7.7.1908 bash # Run an online container similar to your offline machine
# In the online container:
cd /tmp
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo # Add Docker repo
yum makecache fast # Update Yum cache
yum list docker-ce --showduplicates | sort -r # Choose a version
yumdownloader --resolve docker-ce-20.10.5-3.el7 # Download all non-installed RPM depencencies
Upload all the RPM packages to your offline machine. You can make a tar out of them:
tar cvzf docker-rpm-deps.tar.gz * # Create an archive of all the RPMs
Install all the RPMs
# In the offline machine
tar xzvf docker-rpm-deps.tar.gz -C /tmp # Exctract archive
cd /tmp
rpm -ivh --replacefiles --replacepkgs *.rpm # Install all .rpm in the current folder
Voila! Now you just need to enable and start docker.
systemctl enable docker.service
systemctl start docker.service
If, when you are in the offline machine, you still miss an RPM package you can download all the needed RPMs with the command below
# Instead of using yumdownloader
repotrack -a x86_64 -p ./docker-rpm-pkgs docker-ce-20.10.5-3.el7 # Download all RPM dependencies, even the already installed ones
you must download the DEB package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
Install from a package
If you cannot use Docker’s repository to install Docker CE, you can download the .deb file for your release and install it manually. You will need to download a new file each time you want to upgrade Docker CE.
1.Go to [https://download.docker.com/linux/ubuntu/dists/], choose your Ubuntu version, browse to pool/stable/ and choose amd64, armhf, ppc64el, or s390x. Download the .deb file for the Docker version you want to install.
Note: To install an edge package, change the word stable in the URL to edge.
Install Docker CE, changing the path below to the path where you downloaded the Docker package.
$ sudo dpkg -i /path/to/package.deb
and run
$ sudo docker version
to peresent docker version and succeed of inestallation.

Resources