From 9f8deb470a924b26c58e10fcea608778a21a3072 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Sat, 15 Feb 2025 18:30:24 +0800 Subject: [PATCH 01/11] Improve docker --- distribution/docker/Dockerfile | 89 ++++++++++++++++++---------------- distribution/docker/druid.sh | 8 ++- 2 files changed, 54 insertions(+), 43 deletions(-) diff --git a/distribution/docker/Dockerfile b/distribution/docker/Dockerfile index 6b16ec2b94f3..c7dbc9232b8a 100644 --- a/distribution/docker/Dockerfile +++ b/distribution/docker/Dockerfile @@ -19,68 +19,73 @@ ARG JDK_VERSION=17 +# By default we build the entire distribution from source in docker +# This can be unset if the tarball was already built outside of Docker +ARG BUILD_FROM_SOURCE="true" + # The platform is explicitly specified as x64 to build the Druid distribution. # This is because it's not able to build the distribution on arm64 due to dependency problem of web-console. See: https://github.com/apache/druid/issues/13012 # Since only java jars are shipped in the final image, it's OK to build the distribution on x64. # Once the web-console dependency problem is resolved, we can remove the --platform directive. -FROM --platform=linux/amd64 maven:3.9 as builder +FROM openjdk:${JDK_VERSION}-jdk-slim as web-console-builder +RUN apt-get -qq update \ + && apt-get -qq -y install --no-install-recommends maven -# Rebuild from source in this stage -# This can be unset if the tarball was already built outside of Docker -ARG BUILD_FROM_SOURCE="true" +COPY . /src + +# Re-declare the ARG to make it available in this stage +ARG BUILD_FROM_SOURCE + +# Build web-console +RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ + cd /src/web-console && mvn -B -ff -DskipUTs clean package\ +; fi + +# +# Declare a builder stage to build the Druid distribution +# +FROM openjdk:${JDK_VERSION}-jdk-slim as builder -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt-get -qq update \ - && apt-get -qq -y install --no-install-recommends python3 python3-yaml +RUN apt-get -qq update \ + && apt-get -qq -y install --no-install-recommends python3 python3-yaml maven COPY . /src WORKDIR /src + +# Copy the web-console jar from the web-console-builder to include it in the distribution +COPY --from=web-console-builder /src/web-console/target/web-console*.jar /src/web-console/target/ + +# Re-declare the ARG to make it available in this stage +ARG BUILD_FROM_SOURCE + +# Note: 'clean' is necessary to make sure distrubution/target is cleared +# because later we will use 'tar -zxf' to extract tar files under this directory RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ - mvn -B -ff -q \ - install \ + mvn -B -ff \ + clean install \ -Pdist,bundle-contrib-exts \ -Pskip-static-checks,skip-tests \ - -Dmaven.javadoc.skip=true -T1C \ + -pl '!org.apache.druid:web-console, !org.apache.druid:druid-benchmarks, !org.apache.druid:druid-integration-tests, !org.apache.druid.integration-tests:druid-it-tools, !org.apache.druid.integration-tests:druid-it-image, !org.apache.druid.integration-tests:druid-it-cases, !org.apache.druid:druid-quidem-ut' \ + -T1C \ ; fi -RUN --mount=type=cache,target=/root/.m2 VERSION=$(mvn -B -q org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \ - -Dexpression=project.version -DforceStdout=true \ - ) \ - && tar -zxf ./distribution/target/apache-druid-${VERSION}-bin.tar.gz -C /opt \ - && mv /opt/apache-druid-${VERSION} /opt/druid +RUN DISTRIBUTION=$(ls ./distribution/target/apache-druid-*-bin.tar.gz) \ + && tar -zxf ${DISTRIBUTION} -C /opt \ + && mv /opt/apache-druid-* /opt/druid -FROM alpine:3 as bash-static -ARG TARGETARCH -# -# Download bash-static binary to execute scripts that require bash. -# Although bash-static supports multiple platforms, but there's no need for us to support all those platform, amd64 and arm64 are enough. -# -ARG BASH_URL_BASE="https://github.com/robxu9/bash-static/releases/download/5.1.016-1.2.3" -RUN if [ "$TARGETARCH" = "arm64" ]; then \ - BASH_URL="${BASH_URL_BASE}/bash-linux-aarch64" ; \ - elif [ "$TARGETARCH" = "amd64" ]; then \ - BASH_URL="${BASH_URL_BASE}/bash-linux-x86_64" ; \ - else \ - echo "Unsupported architecture ($TARGETARCH)" && exit 1; \ - fi; \ - echo "Downloading bash-static from ${BASH_URL}" \ - && wget ${BASH_URL} -O /bin/bash - -FROM busybox:1.35.0-glibc as busybox - -FROM gcr.io/distroless/java$JDK_VERSION-debian12 -LABEL maintainer="Apache Druid Developers " -COPY --from=busybox /bin/busybox /busybox/busybox -RUN ["/busybox/busybox", "--install", "/bin"] +FROM alpine:latest +LABEL maintainer="Apache Druid Developers " +# Re-daclare the ARG to make it available in this stage +ARG JDK_VERSION -RUN addgroup -S -g 1000 druid \ +# Install necessary packages to easier debugging +RUN apk add --no-cache openjdk${JDK_VERSION}-jre bash curl net-tools strace lsof \ + && addgroup -S -g 1000 druid \ && adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid - -COPY --from=bash-static /bin/bash /bin/bash -RUN chmod 755 /bin/bash +ENV JAVA_HOME=/usr/lib/jvm/java-${JDK_VERSION}-openjdk COPY distribution/docker/druid.sh /druid.sh COPY distribution/docker/peon.sh /peon.sh diff --git a/distribution/docker/druid.sh b/distribution/docker/druid.sh index 820416078a36..4a8c18eea1a6 100755 --- a/distribution/docker/druid.sh +++ b/distribution/docker/druid.sh @@ -141,7 +141,13 @@ fi DRUID_SET_HOST_IP=${DRUID_SET_HOST_IP:-0} if [ "${DRUID_SET_HOST_IP}" = "1" ] then - setKey $SERVICE druid.host $(ip r get 1 | awk '{print $7;exit}') + # Get local ip from the 'ip' tool + IP=$(ip r get 1 | awk '{print $7;exit}') + if [ -z "$IP" ]; then + echo "ERROR: IP address not found." + exit 1 + fi + setKey $SERVICE druid.host $IP fi env | grep ^druid_ | while read evar; From 7eded9e9be31ff913f373a4f8143e3a3c1829182 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Sat, 15 Feb 2025 19:10:39 +0800 Subject: [PATCH 02/11] Update doc --- distribution/docker/README.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/distribution/docker/README.md b/distribution/docker/README.md index 7be1529c02f1..64b6cc514ae1 100644 --- a/distribution/docker/README.md +++ b/distribution/docker/README.md @@ -19,23 +19,18 @@ ## Build -From the root of the repo, run following command: +From the root of the repo, run the following command: ```bash DOCKER_BUILDKIT=1 docker build -t apache/druid:tag -f distribution/docker/Dockerfile . ``` -### Building images on Apple M1/M2 -To build images on Apple M1/M2, you need to follow the instructions in this section. - -1. build Druid distribution from the root of the repo - ```bash - mvn clean package -DskipTests -Pdist - ``` -2. build target image - ``` - DOCKER_BUILDKIT=1 docker build -t apache/druid:tag -f distribution/docker/Dockerfile --build-arg BUILD_FROM_SOURCE=false . - ``` +There re two extra build arguments that can be passed to the build command by using `--build-arg` flag. + +| Building argument | Description | Default value | +|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| +| JDK_VERSION | The version of JDK to use. By default JDK 17 is used. Use 17 and above. | 17 | +| BUILD_FROM_SOURCE | Whether to build Druid from source inside docker.
If you already build the distribution outside the docker, you can manully set this argument to false to speed up building. | true | ## Run From 4f72b13c4236af429cd407d252e431efa4f4764f Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Sat, 15 Feb 2025 21:30:11 +0800 Subject: [PATCH 03/11] Update building stage images to use latest JDK release --- distribution/docker/Dockerfile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/distribution/docker/Dockerfile b/distribution/docker/Dockerfile index c7dbc9232b8a..1d634c65bcf3 100644 --- a/distribution/docker/Dockerfile +++ b/distribution/docker/Dockerfile @@ -27,9 +27,7 @@ ARG BUILD_FROM_SOURCE="true" # This is because it's not able to build the distribution on arm64 due to dependency problem of web-console. See: https://github.com/apache/druid/issues/13012 # Since only java jars are shipped in the final image, it's OK to build the distribution on x64. # Once the web-console dependency problem is resolved, we can remove the --platform directive. -FROM openjdk:${JDK_VERSION}-jdk-slim as web-console-builder -RUN apt-get -qq update \ - && apt-get -qq -y install --no-install-recommends maven +FROM --platform=linux/amd64 maven:3.9.9-eclipse-temurin-${JDK_VERSION} as web-console-builder COPY . /src @@ -38,16 +36,15 @@ ARG BUILD_FROM_SOURCE # Build web-console RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ - cd /src/web-console && mvn -B -ff -DskipUTs clean package\ + cd /src/web-console && mvn -B -ff -Dpmd.skip=true -DskipUTs=true clean package\ ; fi # # Declare a builder stage to build the Druid distribution # -FROM openjdk:${JDK_VERSION}-jdk-slim as builder - +FROM maven:3.9.9-eclipse-temurin-${JDK_VERSION} as builder RUN apt-get -qq update \ - && apt-get -qq -y install --no-install-recommends python3 python3-yaml maven + && apt-get -qq -y install --no-install-recommends python3 python3-yaml COPY . /src WORKDIR /src @@ -61,19 +58,20 @@ ARG BUILD_FROM_SOURCE # Note: 'clean' is necessary to make sure distrubution/target is cleared # because later we will use 'tar -zxf' to extract tar files under this directory RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ - mvn -B -ff \ + mvn -B -ff -ntp \ clean install \ -Pdist,bundle-contrib-exts \ -Pskip-static-checks,skip-tests \ -pl '!org.apache.druid:web-console, !org.apache.druid:druid-benchmarks, !org.apache.druid:druid-integration-tests, !org.apache.druid.integration-tests:druid-it-tools, !org.apache.druid.integration-tests:druid-it-image, !org.apache.druid.integration-tests:druid-it-cases, !org.apache.druid:druid-quidem-ut' \ - -T1C \ - ; fi + -T1C \ +; fi RUN DISTRIBUTION=$(ls ./distribution/target/apache-druid-*-bin.tar.gz) \ && tar -zxf ${DISTRIBUTION} -C /opt \ && mv /opt/apache-druid-* /opt/druid - +# The bulding stagings use images based on eclipse-temurin, +# however here we directly use alpine because eclipse-temurin-alpine for JRE17 does not ship a image with ARM64 architecture. FROM alpine:latest LABEL maintainer="Apache Druid Developers " From 0ece58481e9d6174cfbe543595b3b2720e5628a4 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 18:30:03 +0800 Subject: [PATCH 04/11] Improve --- .dockerignore | 7 +++++-- distribution/docker/Dockerfile | 38 +++++++++++++++++++++++----------- web-console/pom.xml | 1 - 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/.dockerignore b/.dockerignore index d7ae5a9cf590..34d9076ad073 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,5 @@ # -# Licensed to the Apache Software Foundation (ASF) under one +#i Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file @@ -20,7 +20,9 @@ **/*.jar **/*.class dist -target +**/target +# Keep the target of distribution since we support to build the docker directly by the distribution file built on host machine +#!distribution/target *.iml *.ipr *.iws @@ -35,3 +37,4 @@ target *.DS_Store _site dependency-reduced-pom.xml +**/node_modules diff --git a/distribution/docker/Dockerfile b/distribution/docker/Dockerfile index 1d634c65bcf3..5b8e0d9b28da 100644 --- a/distribution/docker/Dockerfile +++ b/distribution/docker/Dockerfile @@ -27,16 +27,28 @@ ARG BUILD_FROM_SOURCE="true" # This is because it's not able to build the distribution on arm64 due to dependency problem of web-console. See: https://github.com/apache/druid/issues/13012 # Since only java jars are shipped in the final image, it's OK to build the distribution on x64. # Once the web-console dependency problem is resolved, we can remove the --platform directive. -FROM --platform=linux/amd64 maven:3.9.9-eclipse-temurin-${JDK_VERSION} as web-console-builder +FROM --platform=linux/amd64 node:20.9.0-slim as web-console-builder -COPY . /src +RUN npm install -g npm@10.9.0 + +# Only copy necessary files to web-console to build to try the best to use docker cache +COPY ./web-console /src/web-console +COPY ./docs /src/docs +WORKDIR /src/web-console # Re-declare the ARG to make it available in this stage -ARG BUILD_FROM_SOURCE +ARG BUILD_FROM_SOURCE="true" -# Build web-console -RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ - cd /src/web-console && mvn -B -ff -Dpmd.skip=true -DskipUTs=true clean package\ +ENV NODE_OPTIONS=--openssl-legacy-provider + +# The ls command below is just for debug helping us know which files are updated that docker cache are invalidated +RUN if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ + ls -l && \ + npm ci \ +; fi +RUN if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ + ./script/build \ + && ./script/cp-to ./target/resources \ ; fi # @@ -49,20 +61,22 @@ RUN apt-get -qq update \ COPY . /src WORKDIR /src -# Copy the web-console jar from the web-console-builder to include it in the distribution -COPY --from=web-console-builder /src/web-console/target/web-console*.jar /src/web-console/target/ +# Copy the web-console resources from the web-console-builder to include it in this stage to package +COPY --from=web-console-builder /src/web-console/target/resources /src/web-console/target/resources # Re-declare the ARG to make it available in this stage ARG BUILD_FROM_SOURCE -# Note: 'clean' is necessary to make sure distrubution/target is cleared -# because later we will use 'tar -zxf' to extract tar files under this directory +# Note: use web.console.skip to exclude building of web-console but include the package of web-console RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ + rm -fr distribution/target/ && \ mvn -B -ff -ntp \ - clean install \ + install \ + -s settings.xml \ -Pdist,bundle-contrib-exts \ -Pskip-static-checks,skip-tests \ - -pl '!org.apache.druid:web-console, !org.apache.druid:druid-benchmarks, !org.apache.druid:druid-integration-tests, !org.apache.druid.integration-tests:druid-it-tools, !org.apache.druid.integration-tests:druid-it-image, !org.apache.druid.integration-tests:druid-it-cases, !org.apache.druid:druid-quidem-ut' \ + -Dweb.console.skip=true \ + -pl '!org.apache.druid:druid-benchmarks, !org.apache.druid:druid-integration-tests, !org.apache.druid.integration-tests:druid-it-tools, !org.apache.druid.integration-tests:druid-it-image, !org.apache.druid.integration-tests:druid-it-cases' \ -T1C \ ; fi diff --git a/web-console/pom.xml b/web-console/pom.xml index 60543703e67e..b5bde00c5297 100644 --- a/web-console/pom.xml +++ b/web-console/pom.xml @@ -154,7 +154,6 @@ maven-resources-plugin ${project.build.outputDirectory}/org/apache/druid/console - ${web.console.skip} From e79e2409fc4e04de62f0662490d5eaaf1579d653 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 20:52:37 +0800 Subject: [PATCH 05/11] Improve docker cache for web-console --- .dockerignore | 9 +++++++-- distribution/docker/Dockerfile | 26 +++++++++++++++++++------- web-console/package.json | 2 +- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.dockerignore b/.dockerignore index 34d9076ad073..bc1fd030add7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -20,9 +20,14 @@ **/*.jar **/*.class dist + **/target -# Keep the target of distribution since we support to build the docker directly by the distribution file built on host machine -#!distribution/target + +# To support building the docker image from the distribution file built on host machine, +# we need to keep binary files under targett directory of distribution module. +# This rule MUST be after above '**/target' rule +!distribution/target/*-bin.tar.gz + *.iml *.ipr *.iws diff --git a/distribution/docker/Dockerfile b/distribution/docker/Dockerfile index 5b8e0d9b28da..4df19f856575 100644 --- a/distribution/docker/Dockerfile +++ b/distribution/docker/Dockerfile @@ -23,6 +23,9 @@ ARG JDK_VERSION=17 # This can be unset if the tarball was already built outside of Docker ARG BUILD_FROM_SOURCE="true" +#=============================================================== +# web-console building stage +#=============================================================== # The platform is explicitly specified as x64 to build the Druid distribution. # This is because it's not able to build the distribution on arm64 due to dependency problem of web-console. See: https://github.com/apache/druid/issues/13012 # Since only java jars are shipped in the final image, it's OK to build the distribution on x64. @@ -37,23 +40,27 @@ COPY ./docs /src/docs WORKDIR /src/web-console # Re-declare the ARG to make it available in this stage -ARG BUILD_FROM_SOURCE="true" +ARG BUILD_FROM_SOURCE +# Suppress a building error saying error:0308010C:digital envelope routines::unsupported ENV NODE_OPTIONS=--openssl-legacy-provider -# The ls command below is just for debug helping us know which files are updated that docker cache are invalidated +# The directory of output, during the package stage, files will be copied from this directory +RUN mkdir /output + +# The ls command below is just for debug purpose helping us know which files are updated that docker cache are invalidated RUN if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ ls -l && \ npm ci \ ; fi RUN if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ ./script/build \ - && ./script/cp-to ./target/resources \ + && ./script/cp-to ./output \ ; fi -# +#=============================================================== # Declare a builder stage to build the Druid distribution -# +#=============================================================== FROM maven:3.9.9-eclipse-temurin-${JDK_VERSION} as builder RUN apt-get -qq update \ && apt-get -qq -y install --no-install-recommends python3 python3-yaml @@ -62,7 +69,7 @@ COPY . /src WORKDIR /src # Copy the web-console resources from the web-console-builder to include it in this stage to package -COPY --from=web-console-builder /src/web-console/target/resources /src/web-console/target/resources +COPY --from=web-console-builder /output /src/web-console/target/resources # Re-declare the ARG to make it available in this stage ARG BUILD_FROM_SOURCE @@ -80,11 +87,16 @@ RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; th -T1C \ ; fi + +# RUN ls ./distribution/target RUN DISTRIBUTION=$(ls ./distribution/target/apache-druid-*-bin.tar.gz) \ && tar -zxf ${DISTRIBUTION} -C /opt \ && mv /opt/apache-druid-* /opt/druid -# The bulding stagings use images based on eclipse-temurin, +#=============================================================== +# Final stage +#=============================================================== +# Above bulding staging uses images based on eclipse-temurin, # however here we directly use alpine because eclipse-temurin-alpine for JRE17 does not ship a image with ARM64 architecture. FROM alpine:latest LABEL maintainer="Apache Druid Developers " diff --git a/web-console/package.json b/web-console/package.json index 39eae99e101b..f0ad061c243c 100644 --- a/web-console/package.json +++ b/web-console/package.json @@ -31,7 +31,7 @@ "sasslint-fix-changed-only": "npm run sasslint-changed-only -- --fix", "prettify": "prettier --write '{src,e2e-tests}/**/*.{ts,tsx,scss}' './*.js'", "prettify-check": "prettier --check '{src,e2e-tests}/**/*.{ts,tsx,scss}' './*.js'", - "generate-licenses-file": "license-checker --production --json --out licenses.json", + "generate-licenses-file": "license-checker --production --json --out target/licenses.json", "check-licenses": "license-checker --production --onlyAllow 'Apache-1.1;Apache-2.0;BSD-2-Clause;BSD-3-Clause;0BSD;MIT;ISC;CC0-1.0;OFL-1.1' --summary", "start": "webpack serve" }, From ccaebf7be04b3e73a0fd196564225ee68678bd36 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 21:08:07 +0800 Subject: [PATCH 06/11] Add comments --- web-console/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web-console/pom.xml b/web-console/pom.xml index b5bde00c5297..b6903af97271 100644 --- a/web-console/pom.xml +++ b/web-console/pom.xml @@ -34,6 +34,10 @@ ${project.build.directory}/resources false + + v20.9.0 10.9.0 @@ -150,6 +154,9 @@ + org.apache.maven.plugins maven-resources-plugin From 6343fb95f5bd9b7b123676b900a5eb269af1b036 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 21:10:23 +0800 Subject: [PATCH 07/11] Enable distribution check when web-console module is changed --- .github/workflows/distribution-checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/distribution-checks.yml b/.github/workflows/distribution-checks.yml index caadb16b608e..9adeecf76468 100644 --- a/.github/workflows/distribution-checks.yml +++ b/.github/workflows/distribution-checks.yml @@ -22,6 +22,7 @@ on: - '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' # release branches paths: - 'distribution/**' + - 'web-console/**' - '**/pom.xml' pull_request: branches: From c5e988c5a60244e67f33b897afb7c00084ca354e Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 21:25:28 +0800 Subject: [PATCH 08/11] Fix --- distribution/docker/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/distribution/docker/Dockerfile b/distribution/docker/Dockerfile index 4df19f856575..907fb03405e7 100644 --- a/distribution/docker/Dockerfile +++ b/distribution/docker/Dockerfile @@ -79,7 +79,6 @@ RUN --mount=type=cache,target=/root/.m2 if [ "$BUILD_FROM_SOURCE" = "true" ]; th rm -fr distribution/target/ && \ mvn -B -ff -ntp \ install \ - -s settings.xml \ -Pdist,bundle-contrib-exts \ -Pskip-static-checks,skip-tests \ -Dweb.console.skip=true \ From e4be4e25f5fd581cd2bc28b73dae620ae1f6d86a Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 21:30:46 +0800 Subject: [PATCH 09/11] Fix two docker file warnings --- distribution/docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distribution/docker/Dockerfile b/distribution/docker/Dockerfile index 907fb03405e7..8f0fb23efdf9 100644 --- a/distribution/docker/Dockerfile +++ b/distribution/docker/Dockerfile @@ -30,7 +30,7 @@ ARG BUILD_FROM_SOURCE="true" # This is because it's not able to build the distribution on arm64 due to dependency problem of web-console. See: https://github.com/apache/druid/issues/13012 # Since only java jars are shipped in the final image, it's OK to build the distribution on x64. # Once the web-console dependency problem is resolved, we can remove the --platform directive. -FROM --platform=linux/amd64 node:20.9.0-slim as web-console-builder +FROM --platform=linux/amd64 node:20.9.0-slim AS web-console-builder RUN npm install -g npm@10.9.0 @@ -61,7 +61,7 @@ RUN if [ "$BUILD_FROM_SOURCE" = "true" ]; then \ #=============================================================== # Declare a builder stage to build the Druid distribution #=============================================================== -FROM maven:3.9.9-eclipse-temurin-${JDK_VERSION} as builder +FROM maven:3.9.9-eclipse-temurin-${JDK_VERSION} AS builder RUN apt-get -qq update \ && apt-get -qq -y install --no-install-recommends python3 python3-yaml From cb7d8a15dc471f19495a1470b7f51c4429e44595 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 21:32:02 +0800 Subject: [PATCH 10/11] Revert accidental change --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index bc1fd030add7..b325d90ef9af 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,5 @@ # -#i Licensed to the Apache Software Foundation (ASF) under one +# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file From 0539fd19fa18c38e3af0e9626858e6e22d78bcf4 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Mon, 17 Feb 2025 21:33:44 +0800 Subject: [PATCH 11/11] Fix spelling --- .dockerignore | 2 +- distribution/docker/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index b325d90ef9af..0944c3a0e078 100644 --- a/.dockerignore +++ b/.dockerignore @@ -24,7 +24,7 @@ dist **/target # To support building the docker image from the distribution file built on host machine, -# we need to keep binary files under targett directory of distribution module. +# we need to keep binary files under the target directory of distribution module. # This rule MUST be after above '**/target' rule !distribution/target/*-bin.tar.gz diff --git a/distribution/docker/README.md b/distribution/docker/README.md index 64b6cc514ae1..aaedb7462c6f 100644 --- a/distribution/docker/README.md +++ b/distribution/docker/README.md @@ -25,7 +25,7 @@ From the root of the repo, run the following command: DOCKER_BUILDKIT=1 docker build -t apache/druid:tag -f distribution/docker/Dockerfile . ``` -There re two extra build arguments that can be passed to the build command by using `--build-arg` flag. +There are two extra build arguments that can be passed to the build command by using `--build-arg` flag. | Building argument | Description | Default value | |-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|