lordgamez commented on code in PR #1374:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1374#discussion_r941303138
##########
docker/DockerBuild.sh:
##########
@@ -146,18 +149,31 @@ BUILD_ARGS+=("--build-arg" "UID=${UID_ARG}"
"--build-arg" "GID=${GID_ARG}"
"--build-arg" "MINIFI_VERSION=${MINIFI_VERSION}"
"--build-arg" "DUMP_LOCATION=${DUMP_LOCATION}"
- "--build-arg" "DISTRO_NAME=${DISTRO_NAME}")
+ "--build-arg" "DISTRO_NAME=${DISTRO_NAME}"
+ "--build-arg" "DOCKER_SKIP_TESTS=${DOCKER_SKIP_TESTS}")
-if [ -n "${DOCKER_CCACHE_DUMP_LOCATION}" ]; then
- DOCKER_BUILDKIT=1 docker build "${BUILD_ARGS[@]}" -f ${DOCKERFILE} --target
build -t minifi_build ..
+if [ -n "${DISTRO_NAME}" ]; then
+ echo DOCKER_BUILDKIT=0 docker build "${BUILD_ARGS[@]}" -f ${DOCKERFILE} -t
apacheminificpp:"${TAG}" ..
+ DOCKER_BUILDKIT=0 docker build "${BUILD_ARGS[@]}" -f ${DOCKERFILE} -t
apacheminificpp:"${TAG}" ..
- container_id=$(docker run --rm -d minifi_build sh -c "while true; do sleep
1; done")
- mkdir -p "${DOCKER_CCACHE_DUMP_LOCATION}"
- docker cp "${container_id}:/home/minificpp/.ccache/."
"${DOCKER_CCACHE_DUMP_LOCATION}"
- docker rm -f "${container_id}"
-fi
+ if [ -n "${DOCKER_CCACHE_DUMP_LOCATION}" ]; then
+ container_id=$(docker run --rm -d apacheminificpp:"${TAG}" sh -c "while
true; do sleep 1; done")
+ mkdir -p "${DOCKER_CCACHE_DUMP_LOCATION}"
+ docker cp "${container_id}:/home/minificpp/.ccache/."
"${DOCKER_CCACHE_DUMP_LOCATION}"
+ docker rm -f "${container_id}"
+ fi
+else
+ if [ -n "${DOCKER_CCACHE_DUMP_LOCATION}" ]; then
+ DOCKER_BUILDKIT=1 docker build "${BUILD_ARGS[@]}" -f ${DOCKERFILE}
--target build -t minifi_build ..
-DOCKER_BUILDKIT=0 docker build "${BUILD_ARGS[@]}" -f ${DOCKERFILE} -t
apacheminificpp:"${TAG}" ..
+ container_id=$(docker run --rm -d minifi_build sh -c "while true; do sleep
1; done")
+ mkdir -p "${DOCKER_CCACHE_DUMP_LOCATION}"
+ docker cp "${container_id}:/home/minificpp/.ccache/."
"${DOCKER_CCACHE_DUMP_LOCATION}"
+ docker rm -f "${container_id}"
+ fi
+ echo DOCKER_BUILDKIT=1 docker build "${BUILD_ARGS[@]}" -f ${DOCKERFILE} -t
apacheminificpp:"${TAG}" ..
+ DOCKER_BUILDKIT=1 docker build "${BUILD_ARGS[@]}" -f ${DOCKERFILE} -t
apacheminificpp:"${TAG}" ..
Review Comment:
DOCKER_BUILDKIT enables additional features like the copying of files
between multiple stages and only building specific stages, that we use in the
alpine based docker image. We don't need that in the other distros. I would use
it with `DOCKER_BUILDKIT=1` by default, but I'm not sure if there was a problem
with that on any build machines previously, as it was changed to 0 in the past.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]