2023-07-03 17:58:08 +00:00
|
|
|
FROM docker:dind
|
2023-07-03 17:18:29 +00:00
|
|
|
MAINTAINER Elia El Lazkani <git@lazkani.io>
|
2023-07-03 16:48:20 +00:00
|
|
|
|
|
|
|
ARG ORAS_VERSION="1.0.0"
|
2023-07-03 17:58:08 +00:00
|
|
|
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
2023-07-03 17:37:12 +00:00
|
|
|
|
2023-07-03 16:48:20 +00:00
|
|
|
RUN apk add --virtual .build-deps curl && \
|
|
|
|
export TRIVY_VERSION=$(wget -qO - "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/') && \
|
|
|
|
echo $TRIVY_VERSION && \
|
|
|
|
curl -LO "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" && \
|
|
|
|
mkdir -p trivy-install && \
|
|
|
|
tar -zxf trivy_${TRIVY_VERSION}_*.tar.gz -C trivy-install/ && \
|
|
|
|
mv trivy-install /opt/trivy && \
|
|
|
|
ln -s /opt/trivy/trivy /usr/local/bin/trivy && \
|
2023-07-03 17:37:12 +00:00
|
|
|
apk del .build-deps
|
|
|
|
|
2023-07-03 18:01:57 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/usr/local/bin/trivy"]
|