I'm trying to install the `apt` package in my existing Pi-hole Docker image, but it doesn't include `apt` or `dpkg`, which means I can't install additional software. I'm wondering if I can reference a Dockerfile from my Docker Compose setup to add and install the necessary packages. My Dockerfile starts off with `FROM debian:latest`, followed by commands to update and try to install `apt`. Here's what I have so far:
```
FROM debian:latest
RUN apt-get update && apt-get install -y apt
RUN apt-get update && apt-get install -y apt && rm -rf /var/lib/apt/lists/*
```
And my Docker Compose setup begins like this:
```
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
```
Any advice would be greatly appreciated!
3 Answers
If you want to install additional packages for functionality in the Pi-hole container, try starting with containers from linuxserver.io. They often support docker-mods which allow you to use existing addons or create your own to extend functionality.
The Pi-hole image is actually based on Alpine Linux, which uses `apk` for package management instead of `apt`. So you'll want to switch your approach. You could also consider creating your own Debian/Ubuntu-based Pi-hole image if you prefer using `apt`. That way, you can manage packages as you intend.
Before making modifications to a running container, think about why you need those changes. Remember, all your modifications will be lost when you pull a new image. What are you trying to achieve? It might be better to find a different solution that doesn't require changing the container.
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String