Skip to content
Snippets Groups Projects
Commit 2edee2b2 authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

Update build script for building a docker image

parent dbd9aa08
No related branches found
No related tags found
1 merge request!237Update build script for building a docker image
Pipeline #106820 failed
......@@ -194,10 +194,8 @@ build_base:
$DOCKER_CACHE_PARAMETERS \
--build-arg CASACORE_COMMIT \
--build-arg LOFARSTMAN_COMMIT \
--build-arg DYSCO_COMMIT \
--build-arg IDG_COMMIT \
--build-arg AOFLAGGER_COMMIT \
--build-arg LOFARBEAM_COMMIT \
--build-arg EVERYBEAM_COMMIT \
--build-arg SAGECAL_COMMIT \
--build-arg DP3_COMMIT \
......@@ -225,7 +223,7 @@ install_linc:
fi
docker build \
$DOCKER_CACHE_PARAMETERS \
--build-arg BASE_TAG=$INTEGRATION_BASE_IMAGE \
--build-arg BASE_IMAGE=$INTEGRATION_BASE_IMAGE \
--build-arg LINC_VERSION=$LINC_VERSION \
--file Docker/Dockerfile-linc \
--tag $INTEGRATION_IMAGE \
......
ARG BASE_TAG=latest
FROM $BASE_TAG
ARG BASE_IMAGE
FROM $BASE_IMAGE
ENV EVERYBEAM_DATADIR=/usr/local/share/everybeam \
LINC_DATA_ROOT=/usr/local/share/linc \
......
#! /bin/bash
set -e
#!/bin/bash
#
# This script build the base docker image and the full docker image for LINC.
# It is inspired by the way the docker images are built in the CI/CD pipeline
# (described in the `.gitlab-ci.yml` file).
DOCKER_TAG=latest
set -euo pipefail
docker build ${PWD}/.. -f Dockerfile-base -t ${DOCKER_TAG} && \
docker build ${PWD}/.. -f Dockerfile-linc -t astronrd/linc:${DOCKER_TAG}
\ No newline at end of file
SCRIPT_DIR=$(cd "$(dirname "${0}")" && pwd)
REPO_ROOT="$(git rev-parse --show-toplevel)"
echo "Determining version information ..."
eval $(${SCRIPT_DIR}/fetch_commit_hashes.sh | tee commits.txt)
BASE_NAME=linc-base
BASE_TAG=$(sha256sum commits.txt | cut -d" " -f1)
BASE_IMAGE=${BASE_NAME}:${BASE_TAG}
FULL_NAME=linc-full
FULL_TAG=$(git log -n 1 --pretty=format:%H)
FULL_IMAGE=${FULL_NAME}:${FULL_TAG}
LINC_VERSION=$(${SCRIPT_DIR}/get_scm_version.sh)
LINC_NAME=astronrd/linc
LINC_TAG=${LINC_VERSION//[^[:alnum:]_.-]/-}
LINC_IMAGE=${LINC_NAME}:${LINC_TAG}
# Build the base image, using the previously determined git commit hashes for
# the packages we need to build
docker build \
--build-arg CASACORE_COMMIT=${CASACORE_COMMIT} \
--build-arg LOFARSTMAN_COMMIT=${LOFARSTMAN_COMMIT} \
--build-arg IDG_COMMIT=${IDG_COMMIT} \
--build-arg AOFLAGGER_COMMIT=${AOFLAGGER_COMMIT} \
--build-arg EVERYBEAM_COMMIT=${EVERYBEAM_COMMIT} \
--build-arg SAGECAL_COMMIT=${SAGECAL_COMMIT} \
--build-arg DP3_COMMIT=${DP3_COMMIT} \
--build-arg WSCLEAN_COMMIT=${WSCLEAN_COMMIT} \
--build-arg PYTHONCASACORE_COMMIT=${PYTHONCASACORE_COMMIT} \
--build-arg LINC_VERSION=${LINC_VERSION} \
--progress plain \
--file ${SCRIPT_DIR}/Dockerfile-base \
--tag ${BASE_IMAGE} \
${REPO_ROOT}
# Build the full image, taking the base image as starting point
docker build \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg LINC_VERSION=${LINC_VERSION} \
--progress plain \
--file ${SCRIPT_DIR}/Dockerfile-linc \
--tag ${FULL_IMAGE} \
${REPO_ROOT}
# Tag the full image with LINC version number
docker tag \
${FULL_IMAGE} \
${LINC_IMAGE}
# Tag the full image as latest
docker tag \
${FULL_IMAGE} \
latest
......@@ -30,9 +30,9 @@ The full documentation can be found at the [LINC webpage](https://linc.readthedo
* [WSClean](https://gitlab.com/aroffringa/wsclean) (v3.5 or later)
* [IDG](https://gitlab.com/astron-idg/idg) (v0.7 or later)
* [LofarStMan](https://github.com/lofar-astron/LofarStMan)
* [Dysco](https://github.com/aroffringa/dysco.git) (v1.3 or later)
* casacore
* Python3 (including matplotlib, scipy, astropy)
* [casacore] (https://github.com/casacore/casacore) (v3.5 or later)
* [python-casacore] (https://github.com/casacore/python-casacore) (v3.5 or later)
* Python (including matplotlib, scipy, astropy, etc.) (v3.8 or later)
* [cwltool](https://github.com/common-workflow-language/cwltool) (3.1.20231207110929 or later)
* [toil-cwl-runner](https://github.com/DataBiosphere/toil) (6.0.0 or later)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment