Distroless image, update README.md
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
41
Dockerfile
41
Dockerfile
@@ -1,19 +1,38 @@
|
|||||||
# CLONE
|
#######################################
|
||||||
FROM alpine:3.22 AS cloner
|
FROM alpine:3.22 AS cloner
|
||||||
|
|
||||||
RUN apk add --no-cache git; \
|
RUN apk add --no-cache git; \
|
||||||
git clone --depth=1 https://github.com/Ground-Zerro/DomainMapper.git
|
git clone https://github.com/Ground-Zerro/DomainMapper.git
|
||||||
|
COPY files/custom-dns-list.txt /DomainMapper/custom-dns-list.txt
|
||||||
|
COPY files/config.ini /DomainMapper/config.ini
|
||||||
|
|
||||||
# RUN
|
|
||||||
FROM python:3.12-alpine
|
|
||||||
|
|
||||||
COPY --from=cloner /DomainMapper /usr/src/app
|
#######################################
|
||||||
|
FROM python:3.12-alpine AS pydeps
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=cloner /DomainMapper/requirements.txt .
|
||||||
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/
|
||||||
|
RUN uv pip install --target /python -r requirements.txt
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
COPY files/custom-dns-list.txt custom-dns-list.txt
|
#######################################
|
||||||
COPY files/config.ini config.ini
|
#FROM gcr.io/distroless/python3-debian12:debug
|
||||||
|
FROM gcr.io/distroless/python3-debian12
|
||||||
|
#FROM al3xos/python-distroless:3.13-debian12
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
WORKDIR /app
|
||||||
|
|
||||||
CMD ["python", "main.py"]
|
# Ensure Python finds vendored site-packages and unbuffered output
|
||||||
|
ENV PYTHONPATH=/python
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
ENV PYTHONUTF8=1
|
||||||
|
ENV LANG=C.UTF-8
|
||||||
|
ENV LC_ALL=C.UTF-8
|
||||||
|
|
||||||
|
# Copy application code
|
||||||
|
COPY --from=cloner --chown=65532:65532 /DomainMapper /app
|
||||||
|
|
||||||
|
# Copy vendored Python dependencies
|
||||||
|
COPY --from=pydeps --chown=65532:65532 /python /python
|
||||||
|
|
||||||
|
# No shell or package manager available in distroless
|
||||||
|
ENTRYPOINT ["python3", "main.py"]
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ docker build -t jdm17/domainmapper .
|
|||||||
|
|
||||||
Запуск (для автоматического формирования списка):
|
Запуск (для автоматического формирования списка):
|
||||||
```
|
```
|
||||||
docker run -it --name docker-domainmapper --rm -v "$(pwd)/result.txt:/usr/src/app/domain-ip-resolve.txt" jdm17/domainmapper:latest
|
docker run -it --rm --name docker-domainmapper -v "$(pwd)/result.txt:/app/domain-ip-resolve.txt" jdm17/domainmapper:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Запуск оболочки:
|
Запуск оболочки:
|
||||||
```
|
```
|
||||||
docker run -it --name docker-domainmapper --rm --entrypoint="/bin/sh" -v "$(pwd)/result.txt:/usr/src/app/domain-ip-resolve.txt" jdm17/domainmapper:latest
|
docker run -it --rm --name docker-domainmapper --entrypoint=sh -v "$(pwd)/result.txt:/app/domain-ip-resolve.txt" jdm17/domainmapper:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user