Skip to content

Commit

Permalink
updates containers source for marinara updates (#8154)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandeepsplaha authored Feb 28, 2024
1 parent 0ab15db commit 8bae98a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions .pipelines/containerSourceData/scripts/BuildBaseContainers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,10 @@ function initialization {
# Set various image names.
BASE_IMAGE_NAME="$ACR_NAME_FULL/base/core:$IMAGE_TAG"
BASE_NONROOT_IMAGE_NAME="$ACR_NAME_FULL/base/core:$NONROOT_IMAGE_TAG"

DISTROLESS_BASE_IMAGE_NAME="$ACR_NAME_FULL/distroless/base:$IMAGE_TAG"
DISTROLESS_BASE_NONROOT_IMAGE_NAME="$ACR_NAME_FULL/distroless/base:$NONROOT_IMAGE_TAG"

DISTROLESS_MINIMAL_IMAGE_NAME="$ACR_NAME_FULL/distroless/minimal:$IMAGE_TAG"
DISTROLESS_MINIMAL_NONROOT_IMAGE_NAME="$ACR_NAME_FULL/distroless/minimal:$NONROOT_IMAGE_TAG"

DISTROLESS_DEBUG_NONROOT_IMAGE_NAME="$ACR_NAME_FULL/distroless/debug:$NONROOT_IMAGE_TAG"
DISTROLESS_DEBUG_IMAGE_NAME="$ACR_NAME_FULL/distroless/debug:$IMAGE_TAG"

Expand Down Expand Up @@ -274,17 +271,18 @@ function docker_build_custom {

function docker_build_marinara {
echo "+++ Build Marinara image: $MARINARA_IMAGE_NAME"

local build_dir="$WORK_DIR/marinara_build_dir"
mkdir -p "$build_dir"
git clone "https://github.com/microsoft/$MARINARA.git" "$build_dir"
pushd "$build_dir"

sed -E "s|^FROM mcr\..*installer$|FROM $BASE_IMAGE_NAME as installer|g" -i "dockerfile-$MARINARA"

docker build . \
-t "$MARINARA_IMAGE_NAME" \
-f dockerfile-$MARINARA \
--no-cache
--build-arg AZL_VERSION="$AZL_VERSION" \
--no-cache \
--progress=plain

popd > /dev/null
sudo rm -rf "$build_dir"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function DockerBuild {
docker build . \
-t "$containerName" \
-f "$marinaraSrcDir/dockerfiles/dockerfile-new-image" \
--build-arg MARINER_VERSION="$azureLinuxVersion" \
--build-arg AZL_VERSION="$azureLinuxVersion" \
--build-arg IMAGE_TYPE="$imageType" \
--build-arg PACKAGES_TO_INSTALL="$packagesToInstall" \
--build-arg PACKAGES_TO_HOLDBACK="$packagesToHoldback" \
Expand Down Expand Up @@ -58,7 +58,7 @@ function create_distroless_container {

echo "+++ Clone marinara repo"
git clone "https://github.com/microsoft/$marinara.git" "$WORK_DIR/$marinaraSrcDir"

# It is important to operate from the $WORK_DIR to ensure that docker can access the files.
pushd "$WORK_DIR" > /dev/null

Expand Down Expand Up @@ -113,7 +113,7 @@ function create_distroless_container {
"$rpmsPath"

popd > /dev/null

echo "+++ Save distroless container images to file PublishedContainers-$IMAGE.txt"
{
echo "$standardContainerName";
Expand Down

0 comments on commit 8bae98a

Please sign in to comment.