quiero instalar algunas herramientas de linux en dockerfile
FROM python:2.7 COPY . /app WORKDIR /app RUN pip install --no-cache-dir -r requirements.txt RUN apt-get update RUN apt-get install -y dnsutils CMD ["python","test.py"]Quiero usar python2.7-alpine en el archivo docker.
He usado este código para instalar dnsutils pero el resultado muestra un error
RUN apk update && \ apk add --virtual build-deps gcc python-dev musl-dev && \ apk add postgresql-devQuiero instalar la herramienta dnsutils y python2.7-alpine
puede cambiar el Dockerfile de la siguiente manera
FROM alpine:3.9 RUN apk add --no-cache python && \ python -m ensurepip && \ rm -r /usr/lib/python*/ensurepip && \ pip install --upgrade pip setuptools && \ rm -r /root/.cachePara obtener más información sobre la imagen, puede seguir: https://hub.docker.com/r/frolvlad/alpine-python2/dockerfile
Para instalar dnsutils, instale bind-tools. Utilice el siguiente código
FROM alpine:3.9 MAINTAINER QuangVu COPY . /app WORKDIR /app RUN apk add --no-cache python && \ python -m ensurepip && \ rm -r /usr/lib/python*/ensurepip && \ pip install --upgrade pip setuptools && \ rm -r /root/.cache #RUN pip install --no-cache-dir -r requirements.txt RUN apk add --update --no-cache bind-tools CMD ["python","test.py"]