I'm trying to install MongoDB using the `debian:bookworm` base image in a Docker container, but I'm running into some trouble during the installation process. Here's the Dockerfile I'm using:
```
FROM debian:bookworm
RUN apt update && apt upgrade -y
RUN apt install -y gnupg curl
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc |
gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg
--dearmor
RUN echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list
RUN apt update
RUN apt install -y mongodb-org
```
The steps for adding MongoDB are based on their official instructions. When I build the image, the `apt update` seems to work fine, but I'm getting an error during `apt install` that says it can't locate the `mongodb-org` package:
```
E: Unable to locate package mongodb-org
```
How can I debug this issue? Is there a way to check if the package is actually available? Any insights would be appreciated!
1 Answer
If you're looking to check what's available in the MongoDB repository specifically, you can use `apt-cache policy mongodb-org` after you add the repo. This command can help you validate if the package is accessible and which versions are available. Just make sure you've included the MongoDB sources correctly in your sources list.

Thanks for the tip! But just to clarify, that command will show all available package versions across all sources, right?