I want to install some tools from linux in 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"]
I want to use python2.7-alpine in docker file.
I have used this code to install dnsutils but the result show failed
RUN apk update && \
apk add --virtual build-deps gcc python-dev musl-dev && \
apk add postgresql-dev
I want to install dnsutils tool and python2.7-alpine
you can change the Dockerfile as follows
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/.cache
For more information on the image you can follow: https://hub.docker.com/r/frolvlad/alpine-python2/dockerfile
To install dnsutils install bind-tools. Use the below code
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"]