<p>Have you heard about the <a href="https://github.com/GoogleContainerTools/distroless" rel="nofollow noreferrer">distroless?</a> 
See this <a href="https://github.com/phusion/baseimage-docker" rel="nofollow noreferrer">link</a> too.</p>

CC BY-SA 4.0
2018-12-12T19:01:51.523Z
2018-12-12T19:01:51.523Z
dalmo.santos
<p>I have a simple Dockerfile which looks like the following</p>

<pre><code>FROM debian:stretch-slim as builder
COPY . my_project/
RUN apt-get update &amp;&amp; apt-get install -y build-essential libpqxx-dev libtbb-dev
</code></pre>

<p>Running this with <code>docker build -t test_proj .</code> I was dismayed to see that apt is trying to install a huge amount (583MB unpacked) of extra libs, including things like python and sqlite (which sound completely unnecessary for pqxx and tbb). I ran apt-rdepends over each and sure enough neither python nor sqlite were in there, so there are surely more 'spurious' libs being installed by apt</p>

<p>Why is this happening and how can I avoid this? I plan to use a multistage  to ditch the build tools by the final image anyway, but this is slowing down builds so I'd like to fix it</p>

CC BY-SA 4.0
2018-12-12T10:44:07.530Z
I think [this answer](https://askubuntu.com/a/909786/398662) on aksubuntu is what you're after: `sudo apt-get install --no-install-recommends package-name`
Tensibai
<docker><linux>
Install minimal dependencies with apt
Madden
# Install minimal dependencies with apt

(Asked by: username_0 on 2018-12-12)

I have a simple Dockerfile which looks like the following
FROM debian:stretch-slim as builder
COPY . my_project/
RUN apt-get update && apt-get install -y build-essential libpqxx-dev libtbb-dev

Running this with docker build -t test_proj . I was dismayed to see that apt is trying to install a huge amount (583MB unpacked) of extra libs, including things like python and sqlite (which sound completely unnecessary for pqxx and tbb). I ran apt-rdepends over each and sure enough neither python nor sqlite were in there, so there are surely more 'spurious' libs being installed by apt
Why is this happening and how can I avoid this? I plan to use a multistage  to ditch the build tools by the final image anyway, but this is slowing down builds so I'd like to fix it

**Tags:** docker, linux

> **Comments:**
> **username_1**: I think [this answer](https://askubuntu.com/a/909786/398662) on aksubuntu is what you're after: `sudo apt-get install --no-install-recommends package-name`  

---

## 1 answers

### Answer by username_2 on 2018-12-12. Score: 1

Have you heard about the [distroless?](https://github.com/GoogleContainerTools/distroless)
See this [link](https://github.com/phusion/baseimage-docker) too.


---

