chore(): Removes oras and runs rootful docker in docker
All checks were successful
continuous-integration/drone/promote/production Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Elia el Lazkani 2023-07-03 19:58:08 +02:00
parent aee3f45f50
commit 6b7aa1b2cb
2 changed files with 3 additions and 11 deletions

View file

@ -24,8 +24,6 @@ steps:
- name: trivy-scan - name: trivy-scan
image: scm.project42.io/elia/trivy:production image: scm.project42.io/elia/trivy:production
commands: commands:
- export DOCKER_HOST=unix:///var/run/docker.sock
- /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock
- trivy image scm.project42.io/elia/trivy:pre-scan - trivy image scm.project42.io/elia/trivy:pre-scan
failure: ignore failure: ignore

View file

@ -1,16 +1,10 @@
FROM docker:dind-rootless FROM docker:dind
MAINTAINER Elia El Lazkani <git@lazkani.io> MAINTAINER Elia El Lazkani <git@lazkani.io>
ARG ORAS_VERSION="1.0.0" ARG ORAS_VERSION="1.0.0"
ENV DOCKER_HOST=unix:///var/run/docker.sock
USER root
RUN apk add --virtual .build-deps curl && \ RUN apk add --virtual .build-deps curl && \
curl -LO "https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz" && \
mkdir -p oras-install/ && \
tar -zxf oras_${ORAS_VERSION}_*.tar.gz -C oras-install/ && \
mv oras-install/oras /usr/local/bin/ && \
rm -rf oras_${ORAS_VERSION}_*.tar.gz oras-install/ && \
export TRIVY_VERSION=$(wget -qO - "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/') && \ 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 && \ echo $TRIVY_VERSION && \
curl -LO "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" && \ curl -LO "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" && \
@ -20,4 +14,4 @@ RUN apk add --virtual .build-deps curl && \
ln -s /opt/trivy/trivy /usr/local/bin/trivy && \ ln -s /opt/trivy/trivy /usr/local/bin/trivy && \
apk del .build-deps apk del .build-deps
USER rootless ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/trivy"]