Can't install latest nginx version when using debian:jessie - docker

I am trying to enable HTTP2 for my nginx and I have his dockerfile where I use debian:jessie docker image and I try to install nginx:
FROM debian:jessie
RUN apt-get update && apt-get install -y nginx
RUN nginx -v
Unfortunatelly, when running it, I see nginx version: nginx/1.6.2 and according to documentation HTTP2 is available on 1.9.5 or newer.
Why does it install 1.6.2 and not newer? And how can I update it?

Debian Jessie was released in 2015 and should no longer be used in any production system, as all kinds of support ended in 2020.
Usually, Debian does not provide upgraded versions of the packages they use. If you want to use more current packages, use either a more current version of Debian or a distribution with rolling releases

Related

Docker build dependent on host Ubuntu version not on the actual Docker File

I'm facing an issue with my docker build.
I have a dockerfile as follow:
FROM python:3.6
RUN apt-get update && apt-get install -y libav-tools
....
The issue I'm facing is that I'm getting this error when building on ubuntu:20.04 LTS
E: Package 'libav-tools' has no installation candidate
I made some research and found out that ffmpeg should be a replacement for libav-tools
FROM python:3.6
RUN apt-get update && apt-get install -y ffmpeg
....
I tried again without any issue.
but when I tried to build the same image with ffmpeg on ubuntu:16.04 xenial I'm getting a message that
E: Package 'ffmpeg' has no installation candidate
after that, I replace the ffmpeg with libav-tools and it worked on ubuntu:16.04
I'm confused now why docker build is dependant on the host ubuntu version that I'm using and not the actual dockerfile.
shouldn't docker build be coherent whatever the ubuntu version I'm using.
Delete the the existing image and pull it again. Seems you have a old image which may have a different base OS and that is why you are seeing the issue

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?

How do I install docker on RHEL 7 offline?

New to docker.
Need to install docker on a RHEL 7 (no gui) system.
Does the RHEL 7 installation come with docker already on it? If not, where do I get it from? (I cannot use the docker software at docker.com, it has to come from RedHat - government rules, not mine)
Once procured, how do I install it on a system that is not connected to the internet.
I hope I've made my request as simple as possible, let the questions begin.
Red Hat's build of docker is available in the Red Hat Enterprise Linux 7 Extras channel, but only for the Server variant of the product. You can download individual packages from the Customer Portal after login, but it is going to be a bit cumbersome because the docker package has multiple dependencies.
Alternatively, you can use the reposync tool to mirror the entire Extras channel on a network-connected machine which has a subscription. Or you can use yum in download-only mode and copy over the RPMs stored in the cache directory (but please copy them to a regular directory on the target, and use yum install to install them).
Fire up a centos system.
$ sudo yumdownloader docker --resolve
Copy the RPMs over to your RH machine and run:
$ sudo rpm -ivh *rpm
$ sudo systemctl start docker
Gen rpm on CentOS 7 with docker:
$ yumdownloader --resolve docker-ce
Then, install on target:
$ rpm -ivh docker-ce-19.03.11-3.el7.x86_64.rpm

How to use linux Alpine and install ruby 2.1 and nodejs v6.9

I'm trying to create a lightweight docker image but using linux alpine to install specific versions seems to result in many different errors. Currently my working Dockerfile uses
FROM ruby:2.1.10
RUN apt-get install nodejs=6.11.1
but this results in 1.69GB size.
I would like to use linux Alpine and install ruby 2.1 and nodejs 6.9 or 6.11 - how do I go about this
1) I tried starting from ruby:2.1.10-alpine but cannot get apk add nodejs to install with 6.9
2) Also tried starting from node:6.11.1-alpine and installing ruby 2.1
Maybe start from an empty alpine image and install both? Sorry I'm not familiar with Alpine and installing packages on it seems to be specific to the alpine version (maybe I'm wrong with this).
With the help of alpine node and ruby alpine, here is a dockerfile which has ruby and nodejs installed in alpine and it is 130MB in size.
If you are building a alpine dockerfile, then these guidelines might be helpful to you:
apt-get install changes to apk add in alpine.
After adding an apk, you might want to use && rm -rf /var/lib/apk/* after all apk are added. This removes extra files which got cached.
Use fewer RUN statements. Every RUN statement will add up a new layer.

Resources