Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions core/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
ARG AZUL_DOCKER_TAG=17.0.4
FROM azul/zulu-openjdk:$AZUL_DOCKER_TAG
FROM registry.access.redhat.com/ubi8/ubi

ENV JAVA_HOME /usr/lib/jvm/zulu17

RUN \
set -xeu && \
apt-get update -q && \
apt-get install -y -q less python curl && \
rm -rf /var/lib/apt/lists/* && \
yum -y -q install https://cdn.azul.com/zulu/bin/zulu-repo-1.0.0-1.noarch.rpm && \
yum -y -q install python3 zulu17-jdk less && \
yum -q clean all && \
rm -rf /var/cache/yum && \
alternatives --set python /usr/bin/python3 && \
groupadd trino --gid 1000 && \
useradd trino --uid 1000 --gid 1000 && \
mkdir -p /usr/lib/trino /data/trino && \
Expand Down
12 changes: 3 additions & 9 deletions core/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,20 @@ Builds the Trino Docker image
-h Display help
-a Build the specified comma-separated architectures, defaults to amd64,arm64
-r Build the specified Trino release version, downloads all required artifacts
-j Azul JDK version as published in https://hub.docker.com/r/azul/zulu-openjdk
EOF
}

ARCHITECTURES=(amd64 arm64)
TRINO_VERSION=
AZUL_DOCKER_TAG="17.0.4"

while getopts ":a:h:r:j:" o; do
while getopts ":a:h:r:" o; do
case "${o}" in
a)
IFS=, read -ra ARCHITECTURES <<< "$OPTARG"
;;
r)
TRINO_VERSION=${OPTARG}
;;
j)
AZUL_DOCKER_TAG=${OPTARG}
;;
h)
usage
exit 0
Expand Down Expand Up @@ -75,15 +70,14 @@ cp -R default "${WORK_DIR}/"
TAG_PREFIX="trino:${TRINO_VERSION}"

for arch in "${ARCHITECTURES[@]}"; do
echo "🫙 Building the image for $arch using azul/zulu-openjdk:${AZUL_DOCKER_TAG} as a base"
echo "🫙 Building the image for $arch"
docker build \
"${WORK_DIR}" \
--pull \
--platform "linux/$arch" \
-f Dockerfile \
-t "${TAG_PREFIX}-$arch" \
--build-arg "TRINO_VERSION=${TRINO_VERSION}" \
--build-arg "AZUL_DOCKER_TAG=${AZUL_DOCKER_TAG}"
--build-arg "TRINO_VERSION=${TRINO_VERSION}"
done

echo "🧹 Cleaning up the build context directory"
Expand Down