From ea51b1f55a949cb4bca6832c3ecc956b95206062 Mon Sep 17 00:00:00 2001 From: Sebastiano Mariani Date: Thu, 15 Sep 2022 10:35:42 -0700 Subject: [PATCH] Add parametric Dockerhub mirror to MISP and MISP Module images for internal deployment Signed-off-by: Sebastiano Mariani --- modules/Dockerfile | 6 ++++-- server/Dockerfile | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/Dockerfile b/modules/Dockerfile index e0cc25d..22530e8 100644 --- a/modules/Dockerfile +++ b/modules/Dockerfile @@ -1,4 +1,6 @@ -FROM python:3.9-slim-bullseye as builder +ARG DOCKER_HUB_PROXY="" + +FROM "${DOCKER_HUB_PROXY}python:3.9-slim-bullseye" as builder ENV DEBIAN_FRONTEND noninteractive ARG MODULES_TAG ARG MODULES_COMMIT @@ -37,7 +39,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN find . -name "chardet*" | grep -v "chardet-4.0.0" | xargs rm -f -FROM python:3.9-slim-bullseye +FROM "${DOCKER_HUB_PROXY}python:3.9-slim-bullseye" RUN apt-get update && apt-get install -y --no-install-recommends \ libglib2.0-0 \ diff --git a/server/Dockerfile b/server/Dockerfile index e88c1ad..d7efe38 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,4 +1,6 @@ -FROM composer:2.1.14 as composer-build +ARG DOCKER_HUB_PROXY="" + +FROM "${DOCKER_HUB_PROXY}composer:2.1.14" as composer-build ARG MISP_TAG WORKDIR /tmp ADD https://raw.githubusercontent.com/MISP/MISP/${MISP_TAG}/app/composer.json /tmp @@ -7,7 +9,7 @@ FROM composer:2.1.14 as composer-build composer require --with-all-dependencies supervisorphp/supervisor:^4.0 \ guzzlehttp/guzzle php-http/message lstrojny/fxmlrpc --ignore-platform-reqs -FROM debian:bullseye-slim as php-build +FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" as php-build RUN apt-get update; apt-get install -y --no-install-recommends \ gcc \ make \ @@ -25,7 +27,7 @@ FROM debian:bullseye-slim as php-build RUN git clone --recursive --depth=1 https://github.com/kjdev/php-ext-brotli.git && cd php-ext-brotli && phpize && ./configure && make && make install -FROM debian:bullseye-slim as python-build +FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" as python-build RUN apt-get update; apt-get install -y --no-install-recommends \ gcc \ git \ @@ -83,7 +85,7 @@ FROM debian:bullseye-slim as python-build RUN find . -name "Sphinx*" | tee /dev/stderr | grep -v "Sphinx-1.5.5" | xargs rm -f -FROM debian:bullseye-slim +FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" ENV DEBIAN_FRONTEND noninteractive ARG MISP_TAG ARG MISP_COMMIT