From de5cd1ce6f4ed4b8fd1643658e5af54f12745f60 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Tue, 10 Mar 2020 17:36:30 +0000 Subject: [PATCH] update(docker): latest or explicit FALCO_VERSION for docker images via docker build argument Co-authored-by: Lorenzo Fontana Signed-off-by: Leonardo Di Donato --- docker/minimal/Dockerfile | 2 +- docker/slim/Dockerfile | 4 +++- docker/stable/Dockerfile | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docker/minimal/Dockerfile b/docker/minimal/Dockerfile index 5b18287a..4400e8a6 100644 --- a/docker/minimal/Dockerfile +++ b/docker/minimal/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:18.04 as ubuntu LABEL maintainer="cncf-falco-dev@lists.cncf.io" -ARG FALCO_VERSION=0.20.0 +ARG FALCO_VERSION ARG VERSION_BUCKET=bin ENV FALCO_VERSION=${FALCO_VERSION} diff --git a/docker/slim/Dockerfile b/docker/slim/Dockerfile index d98e990b..538d7ae3 100644 --- a/docker/slim/Dockerfile +++ b/docker/slim/Dockerfile @@ -4,8 +4,10 @@ LABEL maintainer="cncf-falco-dev@lists.cncf.io" LABEL RUN="docker run -i -t -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro --name " +ARG FALCO_VERSION=latest ARG VERSION_BUCKET=deb +ENV FALCO_VERSION=${FALCO_VERSION} ENV VERSION_BUCKET=${VERSION_BUCKET} ENV HOST_ROOT /host @@ -28,7 +30,7 @@ RUN apt-get update \ RUN curl -s https://falco.org/repo/falcosecurity-3672BA8F.asc | apt-key add - \ && echo "deb https://dl.bintray.com/falcosecurity/${VERSION_BUCKET} stable main" | tee -a /etc/apt/sources.list.d/falcosecurity.list \ && apt-get update -y \ - && apt-get install -y --no-install-recommends falco \ + && if [ "$FALCO_VERSION" = "latest" ]; then apt-get install -y --no-install-recommends falco; else apt-get install -y --no-install-recommends falco=${FALCO_VERSION}; fi \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/docker/stable/Dockerfile b/docker/stable/Dockerfile index 4b47317c..380c1877 100644 --- a/docker/stable/Dockerfile +++ b/docker/stable/Dockerfile @@ -4,9 +4,11 @@ LABEL maintainer="cncf-falco-dev@lists.cncf.io" LABEL usage="docker run -i -t -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro --name NAME IMAGE" +ARG FALCO_VERSION=latest ARG VERSION_BUCKET=deb ENV VERSION_BUCKET=${VERSION_BUCKET} +ENV FALCO_VERSION=${FALCO_VERSION} ENV HOST_ROOT /host ENV HOME /root @@ -76,7 +78,7 @@ RUN rm -rf /usr/bin/clang \ RUN curl -s https://falco.org/repo/falcosecurity-3672BA8F.asc | apt-key add - \ && echo "deb https://dl.bintray.com/falcosecurity/${VERSION_BUCKET} stable main" | tee -a /etc/apt/sources.list.d/falcosecurity.list \ && apt-get update -y \ - && apt-get install -y --no-install-recommends falco \ + && if [ "$FALCO_VERSION" = "latest" ]; then apt-get install -y --no-install-recommends falco; else apt-get install -y --no-install-recommends falco=${FALCO_VERSION}; fi \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*