Search code examples
dockeropenssl

Upgrade openssl in Docker


I have a docker container that has OpenSSL 1.1.1k. I want to upgrade openssl package to openssl-1.1.1l. I try update it in Dockerfile like this:

FROM php:7.4.21-fpm-alpine3.13

RUN apk add --update --no-cache \
    openssl

...

But after rebuild my container, openssl version is still 1.1.1k

How can I upgrade openssl version ?

UPD: Command apk --update list | grep -E ^openssl-1 in my docker container shows me the following:

openssl-1.1.1k-r0 x86_64 {openssl} (OpenSSL) [installed]
openssl-1.1.1s-r0 x86_64 {openssl} (OpenSSL) [upgradable from: openssl-1.1.1k-r0]
openssl-1.0.2u-r0 x86_64 {openssl} (openssl)

Also, my Dockerfile has:

RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.8/main' >> /etc/apk/repositories && \
apk add --no-cache libcrypto1.0 libssl1.0 \

But, there are no openssl 1.1.1 packages for alpine 3.8. See

So, my Dockerfile looks like:

FROM php:7.4.21-fpm-alpine3.13

RUN apk add --no-cache --virtual .ext-deps \
    nodejs \
    npm \
    git \
    libzip-dev unzip

RUN apk add --update --no-cache \
    jpegoptim optipng pngquant gifsicle openssl


# Add openssl dependencies for wkhtmltopdf
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.8/main' >> /etc/apk/repositories && \
    apk add --no-cache libcrypto1.0 libssl1.0

What should i do in this case ?


Solution

  • I added the RUN apk update && apk upgrade openssl command to the Dockerfile and rebuilt my container.