<p>you need just to install <code>ca-certificates</code> so update your apt-get command to :</p>
<pre><code>RUN set -ex; \
    apt-get -y install --no-install-recommends \
        ca-certificates \
        curl=7.64.0-4+deb10u1 \
        unzip=6.0-23+deb10u1 \
        coreutils=8.30-3 \
        lsb-release build-essential ssh-client apt-transport-https \
        python gnupg
</code></pre>

CC BY-SA 4.0
2021-01-07T10:58:58.137Z
2021-01-07T10:58:58.137Z
LinPy
<p>I am building a Docker image based on <code>debian:buster-slim</code> and installing cUrl in this image. According to the recommendations made by Hadolint, I install all packages via <code>apt-get</code> with the option <code>--no-install-recommends</code> to avoid the installation of unneeded packages.</p>
<p>Installed in this way, cUrl is not able to get any file via HTTPS due to it is unable to find the &quot;local issues certificate&quot;, as shown in the extract from Docker output below.</p>
<p>Does someone know which additional package I have to install to solve this problem?</p>
<pre><code>Step 15/19 : RUN set -ex;     curl --output distribution.zip $FULL_URL
 ---&gt; Running in 9aa176a788d7
+ curl --output distribution.zip https://www.host.domain/file.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
</code></pre>
<p>This is my current version of the use Dockerfile:</p>
<pre><code>FROM debian:buster-slim

RUN set -ex; 
    apt-get -y update

RUN set -ex; \
    apt-get -y install --no-install-recommends \
        curl=7.64.0-4+deb10u1 \
        unzip=6.0-23+deb10u1 \
        coreutils=8.30-3 \
        lsb-release build-essential ssh-client apt-transport-https \
        python gnupg


RUN set -ex; 
    curl --output distribution.zip https://www.host.domain/file.zip
</code></pre>

<docker>
How to install curl in conjunction with --no-install-recommends in Debian correctly?
Oliver
# How to install curl in conjunction with --no-install-recommends in Debian correctly?

(Asked by: username_0 on 2020-12-28)

I am building a Docker image based on debian:buster-slim and installing cUrl in this image. According to the recommendations made by Hadolint, I install all packages via apt-get with the option --no-install-recommends to avoid the installation of unneeded packages.
Installed in this way, cUrl is not able to get any file via HTTPS due to it is unable to find the "local issues certificate", as shown in the extract from Docker output below.
Does someone know which additional package I have to install to solve this problem?
Step 15/19 : RUN set -ex;     curl --output distribution.zip $FULL_URL
 ---> Running in 9aa176a788d7
+ curl --output distribution.zip https://www.host.domain/file.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

This is my current version of the use Dockerfile:
FROM debian:buster-slim

RUN set -ex; 
    apt-get -y update

RUN set -ex; \
    apt-get -y install --no-install-recommends \
        curl=7.64.0-4+deb10u1 \
        unzip=6.0-23+deb10u1 \
        coreutils=8.30-3 \
        lsb-release build-essential ssh-client apt-transport-https \
        python gnupg


RUN set -ex; 
    curl --output distribution.zip https://www.host.domain/file.zip

**Tags:** docker


---

## 1 answers

### Answer by username_1 on 2021-01-07. Score: 2 | Accepted answer

you need just to install ca-certificates so update your apt-get command to :
RUN set -ex; \
    apt-get -y install --no-install-recommends \
        ca-certificates \
        curl=7.64.0-4+deb10u1 \
        unzip=6.0-23+deb10u1 \
        coreutils=8.30-3 \
        lsb-release build-essential ssh-client apt-transport-https \
        python gnupg


---

