Ensure not use sudo by 'RUN'
If you don't want to preface the docker command with sudo
, create a Unix group called 'docker' and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group. The docker group grants privileges equivalent to the root user.
Risk Level: medium
Platform: Docker
Spectral Rule ID: DOCKR043
REMEDIATION
remove any 'sudo' from your dockerfile
FROM alpine:3.5
RUN apk add --update py2-pip
RUN pip install --upgrade pip
- RUN apt-get install sudo
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
COPY app.py /usr/src/app/
COPY templates/index.html /usr/src/app/templates/
EXPOSE 5000
CMD ["python", "/usr/src/app/app.py"]
Read more:
Updated over 1 year ago