Added Dockerfile
This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
# Install system dependencies (make, pip) as per README
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
git \
|
||||||
|
make \
|
||||||
|
python3-pip \
|
||||||
|
python3-venv \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Ensure local bin is in PATH (for aliases) as per README
|
||||||
|
ENV PATH="/root/.local/bin:$PATH"
|
||||||
|
|
||||||
|
# Create and activate a virtual environment
|
||||||
|
ENV VIRTUAL_ENV=/root/.venvs/pkgmgr
|
||||||
|
RUN python3 -m venv $VIRTUAL_ENV
|
||||||
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||||
|
|
||||||
|
# Copy local package-manager source into the image
|
||||||
|
WORKDIR /root/Repositories/github.com/kevinveenbirkenbach/package-manager
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install Python dependencies and set up the tool non-interactively
|
||||||
|
RUN pip install --upgrade pip \
|
||||||
|
&& pip install PyYAML \
|
||||||
|
&& chmod +x main.py \
|
||||||
|
&& python main.py install package-manager --no-verification --quiet
|
||||||
|
|
||||||
|
# Default entrypoint for pkgmgr
|
||||||
|
ENTRYPOINT ["pkgmgr"]
|
||||||
|
CMD ["--help"]
|
||||||
14
README.md
14
README.md
@@ -51,6 +51,20 @@ The `make setup` command will:
|
|||||||
- Install required packages from `requirements.txt`.
|
- Install required packages from `requirements.txt`.
|
||||||
- Execute `python main.py install` to complete the installation.
|
- Execute `python main.py install` to complete the installation.
|
||||||
|
|
||||||
|
## Docker Quickstart 🐳
|
||||||
|
|
||||||
|
Alternatively to installing locally, you can use Docker: build the image with
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build --no-cache -t pkgmgr .
|
||||||
|
```
|
||||||
|
|
||||||
|
and then run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm pkgmgr --help
|
||||||
|
```
|
||||||
|
|
||||||
## Usage 📖
|
## Usage 📖
|
||||||
|
|
||||||
Run the script with different commands. For example:
|
Run the script with different commands. For example:
|
||||||
|
|||||||
Reference in New Issue
Block a user