forked from liferay/liferay-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_jdk11_jdk8_image.sh
executable file
·57 lines (45 loc) · 1.85 KB
/
build_jdk11_jdk8_image.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
source ./_common.sh
function build_docker_image {
local image_version=$(./release_notes.sh get-version)
DOCKER_IMAGE_TAGS=()
DOCKER_IMAGE_TAGS+=("${LIFERAY_DOCKER_REPOSITORY}/jdk11-jdk8:${image_version}-${TIMESTAMP}")
DOCKER_IMAGE_TAGS+=("${LIFERAY_DOCKER_REPOSITORY}/jdk11-jdk8")
if [ "${1}" == "push" ]
then
check_docker_buildx
docker buildx build \
--build-arg LABEL_BUILD_DATE=$(date "${CURRENT_DATE}" "+%Y-%m-%dT%H:%M:%SZ") \
--build-arg LABEL_NAME="Liferay JDK11 JDK8" \
--build-arg LABEL_VCS_REF=$(git rev-parse HEAD) \
--build-arg LABEL_VCS_URL="https://github.com/liferay/liferay-docker" \
--build-arg LABEL_VERSION="${image_version}" \
--build-arg LABEL_ZULU_8_AMD64_VERSION="${LIFERAY_DOCKER_ZULU_8_AMD64_VERSION}" \
--build-arg LABEL_ZULU_8_ARM64_VERSION="${LIFERAY_DOCKER_ZULU_8_ARM64_VERSION}" \
--builder "liferay-buildkit" \
--platform "${LIFERAY_DOCKER_IMAGE_PLATFORMS}" \
--push \
$(get_docker_image_tags_args "${DOCKER_IMAGE_TAGS[@]}") \
"${TEMP_DIR}" || exit 1
else
remove_temp_dockerfile_target_platform
docker build \
--build-arg LABEL_BUILD_DATE=$(date "${CURRENT_DATE}" "+%Y-%m-%dT%H:%M:%SZ") \
--build-arg LABEL_NAME="Liferay JDK11 JDK8" \
--build-arg LABEL_VCS_REF=$(git rev-parse HEAD) \
--build-arg LABEL_VCS_URL="https://github.com/liferay/liferay-docker" \
--build-arg LABEL_VERSION="${image_version}" \
--build-arg LABEL_ZULU_8_AMD64_VERSION="${LIFERAY_DOCKER_ZULU_8_AMD64_VERSION}" \
--build-arg LABEL_ZULU_8_ARM64_VERSION="${LIFERAY_DOCKER_ZULU_8_ARM64_VERSION}" \
$(get_docker_image_tags_args "${DOCKER_IMAGE_TAGS[@]}") \
"${TEMP_DIR}" || exit 1
fi
}
function main {
delete_local_images "${LIFERAY_DOCKER_REPOSITORY}/jdk11-jdk8"
make_temp_directory templates/jdk11-jdk8
log_in_to_docker_hub
build_docker_image "${1}"
clean_up_temp_directory
}
main "${@}"