Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use latest curl version on docker

Tags:

I've the following docker image

FROM debian:10.7

RUN apt-get update && \
    apt-get install --yes --no-install-recommends curl

when I run it and use curl --version I got version 7.64 but the latest is 7.74 https://curl.haxx.se/download.html

How should I upgrade the curl to the latest version 7.74 ?
is there a way to do it?

like image 389
Beno Odr Avatar asked Dec 27 '20 14:12

Beno Odr


People also ask

How do I update my current version of curl?

Answer. curl package can be updated as any other package using native system tools. Update will be possible only if the OS vendor has the newer version in its repositories. If there are no packages marked for an update, it means that the server already has the latest version provided by the OS vendor.

What is the use of curl command in Docker?

curl is a command line tool and library for transferring data with URLs. curl is used in command lines or scripts to transfer data.

Does Docker Alpine have curl?

Like it says, it's a docker image built on alpine with curl installed. Size 5.93 MB.


1 Answers

You can use the downloaded packages directly to solve this problem by installing with the make command.

FROM debian:10.7

RUN apt-get update && \
    apt-get install --yes --no-install-recommends wget build-essential libcurl4 && \
    wget https://curl.se/download/curl-7.74.0.tar.gz && \
    tar -xvf curl-7.74.0.tar.gz && cd curl-7.74.0 && \
    ./configure && make && make install

Note that it requires running ./configure.

After installation curl will work perfectly in the version you need, in this case, version 7.74.0.

If you want to optimize your container, remove the build-essential package, it alone will consume more than 200MB of storage. To do this, add at the end of the compilation:

apt-get autoremove build-essential
like image 175
Luiz Ferreira Avatar answered Sep 30 '22 19:09

Luiz Ferreira