Skip to content

Commit

Permalink
Unified usage CI_BASE_IMAGE and BUILD_IMAGE_TAG to prevent syntax err…
Browse files Browse the repository at this point in the history
…ors reported by latest docker version.
  • Loading branch information
vogel76 committed Dec 18, 2023
1 parent 4e0af4d commit 78e30a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Modify CI_IMAGE_TAG here and inside script hive/scripts/ci-helpers/build_ci_base_images.sh and run it. Then push images to registry
# To be started from cloned haf source directory.
ARG CI_REGISTRY_IMAGE=registry.gitlab.syncad.com/hive/hive/
ARG CI_IMAGE_TAG=:ubuntu22.04-9
ARG CI_IMAGE_TAG=ubuntu22.04-9
ARG BUILD_IMAGE_TAG

FROM phusion/baseimage:jammy-1.0.1 AS runtime
Expand All @@ -21,7 +21,7 @@ RUN ./scripts/setup_ubuntu.sh --runtime --hived-admin-account="hived_admin" --hi
USER hived_admin
WORKDIR /home/hived_admin

FROM ${CI_REGISTRY_IMAGE}runtime$CI_IMAGE_TAG AS ci-base-image
FROM ${CI_REGISTRY_IMAGE}runtime:$CI_IMAGE_TAG AS ci-base-image

ENV LANG=en_US.UTF-8
ENV PATH="/home/hived_admin/.local/bin:$PATH"
Expand All @@ -40,7 +40,7 @@ WORKDIR /home/hived_admin
# Install additionally packages located in user directory
RUN /usr/local/src/scripts/setup_ubuntu.sh --user

FROM ${CI_REGISTRY_IMAGE}ci-base-image$CI_IMAGE_TAG AS build
FROM ${CI_REGISTRY_IMAGE}ci-base-image:$CI_IMAGE_TAG AS build

ARG BUILD_HIVE_TESTNET=OFF
ENV BUILD_HIVE_TESTNET=${BUILD_HIVE_TESTNET}
Expand Down Expand Up @@ -76,7 +76,7 @@ RUN \
find . -name *.o -type f -delete && \
find . -name *.a -type f -delete

FROM ${CI_REGISTRY_IMAGE}runtime$CI_IMAGE_TAG as base_instance
FROM ${CI_REGISTRY_IMAGE}runtime:$CI_IMAGE_TAG as base_instance

ENV BUILD_IMAGE_TAG=${BUILD_IMAGE_TAG}

Expand Down
8 changes: 5 additions & 3 deletions scripts/ci-helpers/build_ci_base_image.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#! /bin/bash

REGISTRY=${1:-registry.gitlab.syncad.com/hive/hive/}
CI_IMAGE_TAG=:ubuntu22.04-9
CI_IMAGE_TAG=ubuntu22.04-9

docker buildx build --progress=plain --target=runtime \
--build-arg CI_REGISTRY_IMAGE="$REGISTRY" --build-arg CI_IMAGE_TAG=$CI_IMAGE_TAG \
--tag "${REGISTRY}runtime$CI_IMAGE_TAG" --file Dockerfile .
--build-arg BUILD_IMAGE_TAG=$CI_IMAGE_TAG \
--tag "${REGISTRY}runtime:$CI_IMAGE_TAG" --file Dockerfile .


docker buildx build --progress=plain --target=ci-base-image \
--build-arg CI_REGISTRY_IMAGE="$REGISTRY" --build-arg CI_IMAGE_TAG=$CI_IMAGE_TAG \
--tag "${REGISTRY}ci-base-image$CI_IMAGE_TAG" --file Dockerfile .
--build-arg BUILD_IMAGE_TAG=$CI_IMAGE_TAG \
--tag "${REGISTRY}ci-base-image:$CI_IMAGE_TAG" --file Dockerfile .

0 comments on commit 78e30a6

Please sign in to comment.