You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "rich7420 (via GitHub)" <gi...@apache.org> on 2025/12/21 12:00:25 UTC
[PR] HDDS-13426. Trim Ozone docker image size [ozone-docker]
rich7420 opened a new pull request, #47:
URL: https://github.com/apache/ozone-docker/pull/47
To trim Ozone docker image size
jira:
[HDDS-13426](https://issues.apache.org/jira/browse/HDDS-13426)
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on code in PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#discussion_r2646969125
##########
Dockerfile.slim:
##########
@@ -0,0 +1,55 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+FROM ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
+
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+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 && \
+ cd hadoop && \
+ sudo rm -rf \
+ CONTRIBUTING.md \
+ compose \
+ docs \
+ examples \
+ HISTORY.md \
+ kubernetes \
+ README.md \
+ SECURITY.md \
+ share/doc \
+ share/man \
Review Comment:
yap, those are unnecessary
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#discussion_r2647665136
##########
Dockerfile:
##########
@@ -14,14 +14,34 @@
# limitations under the License.
ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
-ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_RUNNER_VERSION=20251225-1-jdk21-slim
Review Comment:
```suggestion
ARG OZONE_RUNNER_VERSION=20251226-1-jdk21-slim
```
##########
Dockerfile:
##########
@@ -14,14 +14,34 @@
# limitations under the License.
ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
-ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_RUNNER_VERSION=20251225-1-jdk21-slim
FROM ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
ARG OZONE_VERSION=2.0.0
ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
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
+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 && \
+ cd hadoop && \
+ sudo rm -rf \
+ CONTRIBUTING.md \
+ compose \
+ docs \
+ examples \
+ HISTORY.md \
+ kubernetes \
+ README.md \
+ SECURITY.md \
+ share/ozone/byteman \
+ smoketest \
+ tests && \
+ sudo rm -f \
+ share/ozone/lib/*-docs-*.jar \
+ share/ozone/lib/ozone-filesystem-hadoop*.jar
Review Comment:
```suggestion
share/ozone/lib/*-docs-*.jar \
share/ozone/lib/ozone-filesystem-hadoop*.jar \
smoketest \
tests
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #47:
URL: https://github.com/apache/ozone-docker/pull/47
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13426. Trim Ozone docker image size [ozone-docker]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#issuecomment-3682641062
@rich7420 can you please share image size before/after this change? (Like I mentioned in https://github.com/apache/ozone/pull/9538, deleting files in a separate `RUN` step does not reduce image size.)
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#discussion_r2646777469
##########
Dockerfile.slim:
##########
@@ -0,0 +1,55 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+FROM ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
+
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+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 && \
+ cd hadoop && \
+ sudo rm -rf \
+ CONTRIBUTING.md \
+ compose \
+ docs \
+ examples \
+ HISTORY.md \
+ kubernetes \
+ README.md \
+ SECURITY.md \
+ share/doc \
+ share/man \
+ share/ozone/byteman \
+ smoketest \
+ tests && \
+ sudo find . -type f \( \
+ -name "*-all.jar" -o \
+ -name "*-docs-*.jar" -o \
+ -name "*-fat.jar" -o \
+ -name "*-shaded.jar" -o \
+ -name "*test*.jar" -o \
+ -name "ozone-filesystem-hadoop*.jar" \
+ \) -delete
Review Comment:
`all`, `fat`, `shaded` and `test` are unnecessary.
We can replace `find` with plain delete, because jars are in a single directory.
```
share/ozone/lib/*-docs-*.jar \
share/ozone/lib/ozone-filesystem-hadoop*.jar \
```
##########
Dockerfile.slim:
##########
@@ -0,0 +1,55 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
Review Comment:
Now this can be set to `20251225-1-jdk21-slim` to use the smaller base image.
##########
Dockerfile.slim:
##########
@@ -0,0 +1,55 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+FROM ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
+
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+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 && \
+ cd hadoop && \
+ sudo rm -rf \
+ CONTRIBUTING.md \
+ compose \
+ docs \
+ examples \
+ HISTORY.md \
+ kubernetes \
+ README.md \
+ SECURITY.md \
+ share/doc \
+ share/man \
Review Comment:
I don't see these in the tarball, are they necessary?
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#issuecomment-3685753040
@adoroszlai thanks for the support!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13426. Trim Ozone docker image size [ozone-docker]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#issuecomment-3684819177
@adoroszlai , my mistake , I've added a slim dockerfile.
Image │ Logical Size │ Compressed Size
Original │ 2.34GB │ 0.82 GB
Slim Optimized │ 1.87GB │ 0.61 GB
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on code in PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#discussion_r2642394804
##########
Dockerfile.slim:
##########
@@ -0,0 +1,43 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+FROM alpine:latest AS extractor
+ARG OZONE_VERSION
+ARG OZONE_URL
+
+WORKDIR /tmp
+RUN apk add --no-cache curl tar && \
+ curl -LSs -o ozone.tar.gz "$OZONE_URL" && \
+ tar zxf ozone.tar.gz && \
+ cd ozone-${OZONE_VERSION} && \
+ rm -rf docs examples share/doc share/man licenses LICENSE.txt NOTICE.txt README.md HISTORY.md SECURITY.md CONTRIBUTING.md compose kubernetes share/ozone/byteman && \
+ find . -type f \( -name "ozone-filesystem-hadoop2-*.jar" -o -name "ozone-filesystem-hadoop3-*.jar" -o -name "ozone-filesystem-hadoop3-client-*.jar" -o -name "*-tests.jar" -o -name "*-test.jar" -o -name "*test*.jar" -o -name "*-docs-*.jar" -o -name "*-shaded.jar" -o -name "*-all.jar" -o -name "*-fat.jar" \) -delete && \
Review Comment:
oh you're right!
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#discussion_r2647748635
##########
Dockerfile:
##########
@@ -14,14 +14,33 @@
# limitations under the License.
ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
-ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_RUNNER_VERSION=20251226-1-jdk21-slim
Review Comment:
```suggestion
ARG OZONE_RUNNER_VERSION=20251226-2-jdk21-slim
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#discussion_r2642403703
##########
Dockerfile.slim:
##########
@@ -0,0 +1,43 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+FROM alpine:latest AS extractor
+ARG OZONE_VERSION
+ARG OZONE_URL
+
+WORKDIR /tmp
+RUN apk add --no-cache curl tar && \
+ curl -LSs -o ozone.tar.gz "$OZONE_URL" && \
+ tar zxf ozone.tar.gz && \
+ cd ozone-${OZONE_VERSION} && \
+ rm -rf docs examples share/doc share/man licenses LICENSE.txt NOTICE.txt README.md HISTORY.md SECURITY.md CONTRIBUTING.md compose kubernetes share/ozone/byteman && \
+ find . -type f \( -name "ozone-filesystem-hadoop2-*.jar" -o -name "ozone-filesystem-hadoop3-*.jar" -o -name "ozone-filesystem-hadoop3-client-*.jar" -o -name "*-tests.jar" -o -name "*-test.jar" -o -name "*test*.jar" -o -name "*-docs-*.jar" -o -name "*-shaded.jar" -o -name "*-all.jar" -o -name "*-fat.jar" \) -delete && \
Review Comment:
Also, `"*-shaded.jar"`, `"*-all.jar"` and `"*-fat.jar"` are unnecessary.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13426. Trim Ozone docker image size [ozone-docker]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#discussion_r2642327555
##########
Dockerfile.slim:
##########
@@ -0,0 +1,43 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+FROM alpine:latest AS extractor
Review Comment:
We don't need the `extractor` stage, deletion can be added to the existing `RUN curl, tar` command.
##########
Dockerfile.slim:
##########
@@ -0,0 +1,43 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+FROM alpine:latest AS extractor
+ARG OZONE_VERSION
+ARG OZONE_URL
+
+WORKDIR /tmp
+RUN apk add --no-cache curl tar && \
+ curl -LSs -o ozone.tar.gz "$OZONE_URL" && \
+ tar zxf ozone.tar.gz && \
+ cd ozone-${OZONE_VERSION} && \
+ rm -rf docs examples share/doc share/man licenses LICENSE.txt NOTICE.txt README.md HISTORY.md SECURITY.md CONTRIBUTING.md compose kubernetes share/ozone/byteman && \
+ find . -type f \( -name "ozone-filesystem-hadoop2-*.jar" -o -name "ozone-filesystem-hadoop3-*.jar" -o -name "ozone-filesystem-hadoop3-client-*.jar" -o -name "*-tests.jar" -o -name "*-test.jar" -o -name "*test*.jar" -o -name "*-docs-*.jar" -o -name "*-shaded.jar" -o -name "*-all.jar" -o -name "*-fat.jar" \) -delete && \
Review Comment:
List of `ozone-filesystem-hadoop2` etc. can be simplified to `ozone-filesystem-hadoop*.jar`.
`"*test*.jar"` covers the other two `tests` conditions.
##########
Dockerfile.slim:
##########
@@ -0,0 +1,43 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+FROM alpine:latest AS extractor
+ARG OZONE_VERSION
+ARG OZONE_URL
+
+WORKDIR /tmp
+RUN apk add --no-cache curl tar && \
+ curl -LSs -o ozone.tar.gz "$OZONE_URL" && \
+ tar zxf ozone.tar.gz && \
+ cd ozone-${OZONE_VERSION} && \
+ rm -rf docs examples share/doc share/man licenses LICENSE.txt NOTICE.txt README.md HISTORY.md SECURITY.md CONTRIBUTING.md compose kubernetes share/ozone/byteman && \
+ find . -type f \( -name "ozone-filesystem-hadoop2-*.jar" -o -name "ozone-filesystem-hadoop3-*.jar" -o -name "ozone-filesystem-hadoop3-client-*.jar" -o -name "*-tests.jar" -o -name "*-test.jar" -o -name "*test*.jar" -o -name "*-docs-*.jar" -o -name "*-shaded.jar" -o -name "*-all.jar" -o -name "*-fat.jar" \) -delete && \
+ find . -type d \( -name "test*" -o -name "tests" -o -name "*test" -o -name "__pycache__" \) -exec rm -rf {} + 2>/dev/null || true && \
+ find . -type f \( -name "*.md" -o -name "*.txt" -o -name "*.pyc" \) ! -path "*/etc/*" ! -path "*/bin/*" ! -path "*/sbin/*" ! -path "*/libexec/*" -delete 2>/dev/null || true
Review Comment:
This command is not needed.
##########
Dockerfile.slim:
##########
@@ -0,0 +1,43 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+FROM alpine:latest AS extractor
+ARG OZONE_VERSION
+ARG OZONE_URL
+
+WORKDIR /tmp
+RUN apk add --no-cache curl tar && \
+ curl -LSs -o ozone.tar.gz "$OZONE_URL" && \
+ tar zxf ozone.tar.gz && \
+ cd ozone-${OZONE_VERSION} && \
+ rm -rf docs examples share/doc share/man licenses LICENSE.txt NOTICE.txt README.md HISTORY.md SECURITY.md CONTRIBUTING.md compose kubernetes share/ozone/byteman && \
Review Comment:
Please list dirs/files to be deleted one per line, in alphabetical order. This makes it easier to understand and reduces diff when making changes later.
I think we should keep `licenses LICENSE.txt NOTICE.txt`.
##########
Dockerfile.slim:
##########
@@ -0,0 +1,43 @@
+# 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.
+
+ARG OZONE_RUNNER_IMAGE=apache/ozone-runner
+ARG OZONE_RUNNER_VERSION=20250410-1-jdk21
+ARG OZONE_VERSION=2.0.0
+ARG OZONE_URL="https://www.apache.org/dyn/closer.lua?action=download&filename=ozone/${OZONE_VERSION}/ozone-${OZONE_VERSION}.tar.gz"
+
+FROM alpine:latest AS extractor
+ARG OZONE_VERSION
+ARG OZONE_URL
+
+WORKDIR /tmp
+RUN apk add --no-cache curl tar && \
+ curl -LSs -o ozone.tar.gz "$OZONE_URL" && \
+ tar zxf ozone.tar.gz && \
+ cd ozone-${OZONE_VERSION} && \
+ rm -rf docs examples share/doc share/man licenses LICENSE.txt NOTICE.txt README.md HISTORY.md SECURITY.md CONTRIBUTING.md compose kubernetes share/ozone/byteman && \
+ find . -type f \( -name "ozone-filesystem-hadoop2-*.jar" -o -name "ozone-filesystem-hadoop3-*.jar" -o -name "ozone-filesystem-hadoop3-client-*.jar" -o -name "*-tests.jar" -o -name "*-test.jar" -o -name "*test*.jar" -o -name "*-docs-*.jar" -o -name "*-shaded.jar" -o -name "*-all.jar" -o -name "*-fat.jar" \) -delete && \
+ find . -type d \( -name "test*" -o -name "tests" -o -name "*test" -o -name "__pycache__" \) -exec rm -rf {} + 2>/dev/null || true && \
Review Comment:
Delete `tests` and `smoketest` in the first `rm -rf` command above. `__pycache__` does not need to be deleted.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-14230. Create slim ozone image [ozone-docker]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #47:
URL: https://github.com/apache/ozone-docker/pull/47#issuecomment-3685778980
Here's the latest result.
Size: 1.88GB
Compressed: 0.62 GB
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org