Skip to content
Snippets Groups Projects
Commit 43f08266 authored by Ujwal Kundur's avatar Ujwal Kundur
Browse files

Introduce BASEIMAGE ARG to avoid redundant dockerfiles

Both oneapi_jug_xl and jug_xl are built from the same
containers/jug/xl.Dockerfile with the base image changed using
build args
parent d15c4e13
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !338. Comments created here will be created in the context of that merge request.
...@@ -272,7 +272,7 @@ oneapi_jug_xl:default: ...@@ -272,7 +272,7 @@ oneapi_jug_xl:default:
script: script:
- cp containers/jug/setup_detectors.py containers/oneapi - cp containers/jug/setup_detectors.py containers/oneapi
- cp detectors.yaml containers/oneapi - cp detectors.yaml containers/oneapi
- docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG} - docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${INTERNAL_TAG}
-f containers/jug/xl.Dockerfile -f containers/jug/xl.Dockerfile
--build-arg INTERNAL_TAG=${INTERNAL_TAG} --build-arg INTERNAL_TAG=${INTERNAL_TAG}
--build-arg BASEIMAGE="oneapi_jug_dev" --build-arg BASEIMAGE="oneapi_jug_dev"
...@@ -300,10 +300,11 @@ oneapi_jug_xl:nightly: ...@@ -300,10 +300,11 @@ oneapi_jug_xl:nightly:
BUILD_IMAGE: "oneapi_jug_xl" BUILD_IMAGE: "oneapi_jug_xl"
script: script:
- cp containers/jug/setup_detectors.py containers/oneapi - cp containers/jug/setup_detectors.py containers/oneapi
- cp detectors.yaml containers/oneapi - cp detectors.yaml containers/oneapi
- sed 's/^FROM.*$/FROM ${DOCKER_REGISTRY}oneapi_jug_dev:${INTERNAL_TAG}/' containers/jug/xl.Dockerfile | - docker build -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${NIGHTLY_TAG}
docker build \- -t ${CI_REGISTRY_IMAGE}/${BUILD_IMAGE}:${NIGHTLY_TAG} -f containers/jug/xl.Dockerfile
--build-arg INTERNAL_TAG=${INTERNAL_TAG} --build-arg INTERNAL_TAG=${INTERNAL_TAG}
--build-arg BASEIMAGE="oneapi_jug_dev"
--build-arg JUG_VERSION=nightly-$(date +%Y-%m-%d_%H-%M-%S)-${INTERNAL_TAG}-$(git rev-parse HEAD) --build-arg JUG_VERSION=nightly-$(date +%Y-%m-%d_%H-%M-%S)-${INTERNAL_TAG}-$(git rev-parse HEAD)
--build-arg NIGHTLY=1 --build-arg NIGHTLY=1
containers/oneapi containers/oneapi
......
#syntax=docker/dockerfile:1.2 #syntax=docker/dockerfile:1.2
ARG DOCKER_REGISTRY="eicweb.phy.anl.gov:4567/containers/eic_container/" ARG DOCKER_REGISTRY="eicweb.phy.anl.gov:4567/containers/eic_container/"
ARG INTERNAL_TAG="testing" ARG INTERNAL_TAG="testing"
ARG BASEIMAGE="jug_dev"
## ======================================================================================== ## ========================================================================================
## STAGE1: spack builder image ## STAGE1: spack builder image
## EIC builder image with spack ## EIC builder image with spack
## ======================================================================================== ## ========================================================================================
FROM ${DOCKER_REGISTRY}jug_dev:${INTERNAL_TAG} FROM ${DOCKER_REGISTRY}${BASEIMAGE}:${INTERNAL_TAG}
ARG EICWEB="https://eicweb.phy.anl.gov/api/v4/projects" ARG EICWEB="https://eicweb.phy.anl.gov/api/v4/projects"
ARG JUGGLER_VERSION="master" ARG JUGGLER_VERSION="master"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment