diff --git a/scripts/ci/create_docker_image.build.sh b/scripts/ci/create_docker_image.build.sh index 94f1a63dc..154211a6f 100755 --- a/scripts/ci/create_docker_image.build.sh +++ b/scripts/ci/create_docker_image.build.sh @@ -9,7 +9,6 @@ cd "$src_dir" . "$script_dir"/version.sh -export build_dir=${build_dir:-_docker_build} tmp_dir=$(mktemp -dt tezos.opam.tezos.XXXXXXXX) cleanup () { @@ -25,7 +24,9 @@ base_image_name="${3-${image_name}_deps:${image_version}}" cat < "$src_dir"/Dockerfile FROM $base_image_name -COPY . tezos +COPY Makefile tezos/ +COPY src tezos/src/ +COPY vendors tezos/vendors/ RUN sudo chown -R opam tezos && \ opam exec -- make -C tezos all build-test EOF diff --git a/scripts/ci/create_docker_image.build_deps.sh b/scripts/ci/create_docker_image.build_deps.sh index 01667073f..5ba48d039 100755 --- a/scripts/ci/create_docker_image.build_deps.sh +++ b/scripts/ci/create_docker_image.build_deps.sh @@ -9,7 +9,6 @@ cd "$src_dir" . "$script_dir"/version.sh -export build_dir=${build_dir:-_docker_build} tmp_dir=$(mktemp -dt tezos.build_deps.tezos.XXXXXXXX) cleanup () { diff --git a/scripts/create_docker_image.sh b/scripts/create_docker_image.sh index 4ad5fa77b..7a1ce1dbf 100755 --- a/scripts/create_docker_image.sh +++ b/scripts/create_docker_image.sh @@ -8,22 +8,40 @@ cd "$src_dir" . "$script_dir"/version.sh -export build_dir=$(mktemp -dt tezos.docker.XXXXXXXX) - +if [ "$1" = "--build-opam" ] ; then + build_opam=yes + shift 1 +fi image_name="${1:-tezos}" image_version="${2:-latest}" +build_dir="${3:-$src_dir/_docker_build}" opam_image_name="${image_name}_opam" build_image_name="${image_name}_build" build_deps_image_name="${image_name}_build_deps" -"$script_dir"/ci/create_docker_image.opam.sh \ - "$opam_image_name" "$image_version" +if [ -n "$build_opam" ] ; then + + export build_dir + + "$script_dir"/ci/create_docker_image.opam.sh \ + "$opam_image_name" "$image_version" + +else + + docker pull registry.gitlab.com/tezos/tezos/opam:latest + docker tag registry.gitlab.com/tezos/tezos/opam:latest \ + "$opam_image_name:$image_version" + +fi "$script_dir"/ci/create_docker_image.build_deps.sh \ - "$build_deps_image_name" "$image_version" "$opam_image_name:$image_version" + "$build_deps_image_name" "$image_version" \ + "$opam_image_name:$image_version" + "$script_dir"/ci/create_docker_image.build.sh \ - "$build_image_name" "$image_version" "$build_deps_image_name" + "$build_image_name" "$image_version" \ + "$build_deps_image_name" "$script_dir"/ci/create_docker_image.minimal.sh \ - "$image_name" "$image_version" "$build_image_name" + "$image_name" "$image_version" "$build_image_name"