This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch latest
in repository https://gitbox.apache.org/repos/asf/ozone-docker.git


The following commit(s) were added to refs/heads/latest by this push:
     new b9fe9d2  HDDS-11809. Remove unnecessary files from ozone Docker image 
(#36)
b9fe9d2 is described below

commit b9fe9d22cecfd509e20b6909bd9ab4b43735ca7c
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Thu Dec 12 16:18:38 2024 +0100

    HDDS-11809. Remove unnecessary files from ozone Docker image (#36)
---
 .dockerignore       |  9 +++++++++
 .env                | 19 +++++++++++++++++++
 Dockerfile          | 14 ++++----------
 build.sh            | 33 ++++++++-------------------------
 docker-compose.yaml | 10 +++++-----
 log4j.properties    | 19 -------------------
 ozone-site.xml      | 27 ---------------------------
 start-ozone-all.sh  | 29 -----------------------------
 8 files changed, 45 insertions(+), 115 deletions(-)

diff --git a/.dockerignore b/.dockerignore
index 378eac2..cadad79 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1 +1,10 @@
+.asf.yaml
 build
+build.sh
+docker-compose.yaml
+docker-config
+.git
+.github
+.gitignore
+NOTICE
+README.md
diff --git a/.env b/.env
new file mode 100644
index 0000000..5d58e0b
--- /dev/null
+++ b/.env
@@ -0,0 +1,19 @@
+# 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
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+OZONE_IMAGE=apache/ozone
+OZONE_IMAGE_FLAVOR=-rocky
+OZONE_IMAGE_VERSION=1.4.1
diff --git a/Dockerfile b/Dockerfile
index b518be1..b8ad74c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,7 +14,8 @@
 # limitations under the License.
 
 ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
-FROM ${OZONE_RUNNER_IMAGE}:20241108-jdk17-1
+ARG OZONE_RUNNER_VERSION=20241108-jdk17-1
+FROM ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
 
 ARG OZONE_VERSION=1.4.1
 ARG 
OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz";
@@ -23,12 +24,5 @@ WORKDIR /opt
 RUN sudo rm -rf /opt/hadoop && curl -LSs -o ozone.tar.gz $OZONE_URL && tar zxf 
ozone.tar.gz && rm ozone.tar.gz && mv ozone* hadoop
 
 WORKDIR /opt/hadoop
-COPY log4j.properties /opt/hadoop/etc/hadoop/log4j.properties
-COPY ozone-site.xml /opt/hadoop/etc/hadoop/ozone-site.xml
-RUN sudo chown -R hadoop:users /opt/hadoop/etc/hadoop
-COPY --chown=hadoop:users start-ozone-all.sh /usr/local/bin/
-COPY --chown=hadoop:users docker-compose.yaml /opt/hadoop/
-COPY --chown=hadoop:users docker-config /opt/hadoop/
-ENV OZONE_CONF_DIR=/etc/hadoop
-ENV OZONE_LOG_DIR=/var/log/hadoop
-CMD ["/usr/local/bin/start-ozone-all.sh"]
+
+CMD ["echo","Please check https://github.com/apache/ozone-docker for 
information."]
diff --git a/build.sh b/build.sh
index 3a546c2..a093cdf 100755
--- a/build.sh
+++ b/build.sh
@@ -14,29 +14,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+set -eu -o pipefail
 
-set -eu
-
-mkdir -p build
-
-ozone_version=1.4.1
-rat_version=0.16.1
-
-if [ ! -d "$DIR/build/apache-rat-${rat_version}" ]; then
-  if type wget 2> /dev/null; then
-    wget 
"https://dlcdn.apache.org/creadur/apache-rat-${rat_version}/apache-rat-${rat_version}-bin.tar.gz";
 -O "$DIR/build/apache-rat.tar.gz"
-  elif type curl 2> /dev/null; then
-    curl -LSs 
"https://dlcdn.apache.org/creadur/apache-rat-${rat_version}/apache-rat-${rat_version}-bin.tar.gz";
 -o "$DIR/build/apache-rat.tar.gz"
-  else
-    exit 1
-  fi
-  cd $DIR/build
-  tar zvxf apache-rat.tar.gz
-  cd -
-fi
-
-java -jar $DIR/build/apache-rat-${rat_version}/apache-rat-${rat_version}.jar 
$DIR -e .dockerignore -e public -e apache-rat-${rat_version} -e .git -e 
.gitignore
-
-docker build --build-arg OZONE_URL -t apache/ozone $@ .
-docker tag apache/ozone apache/ozone:${ozone_version}
+docker build \
+  --build-arg OZONE_RUNNER_IMAGE \
+  --build-arg OZONE_RUNNER_VERSION \
+  --build-arg OZONE_URL \
+  --build-arg OZONE_VERSION \
+  -t apache/ozone:dev \
+  $@ - < Dockerfile
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 15be697..b91cfaf 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -17,14 +17,14 @@
 version: "3"
 services:
    datanode:
-      image: apache/ozone:1.4.1
+      image: ${OZONE_IMAGE}:${OZONE_IMAGE_VERSION}${OZONE_IMAGE_FLAVOR}
       ports:
          - 9864
       command: ["ozone","datanode"]
       env_file:
          - ./docker-config
    om:
-      image: apache/ozone:1.4.1
+      image: ${OZONE_IMAGE}:${OZONE_IMAGE_VERSION}${OZONE_IMAGE_FLAVOR}
       ports:
          - 9874:9874
       environment:
@@ -34,7 +34,7 @@ services:
          - ./docker-config
       command: ["ozone","om"]
    scm:
-      image: apache/ozone:1.4.1
+      image: ${OZONE_IMAGE}:${OZONE_IMAGE_VERSION}${OZONE_IMAGE_FLAVOR}
       ports:
          - 9876:9876
       env_file:
@@ -43,14 +43,14 @@ services:
          ENSURE_SCM_INITIALIZED: /data/metadata/scm/current/VERSION
       command: ["ozone","scm"]
    recon:
-      image: apache/ozone:1.4.1
+      image: ${OZONE_IMAGE}:${OZONE_IMAGE_VERSION}${OZONE_IMAGE_FLAVOR}
       ports:
          - 9888:9888
       env_file:
          - ./docker-config
       command: ["ozone","recon"]
    s3g:
-      image: apache/ozone:1.4.1
+      image: ${OZONE_IMAGE}:${OZONE_IMAGE_VERSION}${OZONE_IMAGE_FLAVOR}
       ports:
          - 9878:9878
       env_file:
diff --git a/log4j.properties b/log4j.properties
deleted file mode 100644
index a481d09..0000000
--- a/log4j.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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 to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-log4j.appender.stdout.layout: org.apache.log4j.PatternLayout
-log4j.rootLogger: INFO, stdout
-log4j.appender.stdout: org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout.ConversionPattern: %d{yyyy-MM-dd HH:mm:ss} %-5p 
%c{1}:%L - %m%n
diff --git a/ozone-site.xml b/ozone-site.xml
deleted file mode 100644
index 66ccabf..0000000
--- a/ozone-site.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
-   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 to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
--->
-<configuration>
-<property><name>ozone.om.ratis.enable</name><value>false</value></property>
-<property><name>ozone.scm.block.client.address</name><value>localhost</value></property>
-<property><name>ozone.scm.datanode.id</name><value>/tmp/datanode.id</value></property>
-<property><name>ozone.scm.client.address</name><value>localhost</value></property>
-<property><name>ozone.metadata.dirs</name><value>/tmp/metadata</value></property>
-<property><name>ozone.scm.names</name><value>localhost</value></property>
-<property><name>ozone.om.address</name><value>localhost</value></property>
-<property><name>ozone.recon.db.dir</name><value>/tmp/metadata/recon</value></property>
-<property><name>ozone.recon.address</name><value>localhost:9891</value></property>
-</configuration>
diff --git a/start-ozone-all.sh b/start-ozone-all.sh
deleted file mode 100755
index edb2706..0000000
--- a/start-ozone-all.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-# 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 to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ozone scm --init
-ozone scm &
-
-#wait for scm startup
-export WAITFOR=localhost:9876
-
-/opt/hadoop/libexec/entrypoint.sh ozone datanode &
-
-/opt/hadoop/libexec/entrypoint.sh ozone om --init
-/opt/hadoop/libexec/entrypoint.sh ozone om &
-sleep 15
-/opt/hadoop/libexec/entrypoint.sh ozone recon &
-/opt/hadoop/libexec/entrypoint.sh ozone s3g


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to