You can easily reproduce the bug with this Dockerfile:
FROM alpine
RUN mkdir /opt/microscanner
WORKDIR /opt/microscanner
VOLUME ["/opt/microscanner"]
ADD https://get.aquasec.com/microscanner .
USER 0
RUN chmod +x microscanner
ARG token
RUN ./microscanner ${token} --html
A simple fix consists to execute chmod and run microscanner in the same RUN command.
On some Docker images, WORKDIR is declared as VOLUME in the Dockerfile. This will cause an error when Aqua microscanner will be executed :
This is a know behavior of docker layers that no capture changes on anonymous volume. See : https://serverfault.com/questions/772227/chmod-not-working-correctly-in-docker
You can easily reproduce the bug with this Dockerfile:
A simple fix consists to execute
chmod
and run microscanner in the same RUN command.