Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use jinja templating to remove distro specific cases in entrypoint.sh #616

Merged
merged 2 commits into from
Jul 29, 2024
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
2 changes: 1 addition & 1 deletion 11/jdk/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down
40 changes: 20 additions & 20 deletions 11/jdk/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/usr/bin/env sh
# ------------------------------------------------------------------------------
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
#
# Licensed 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
#
# https://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.
#
# This script defines `sh` as the interpreter, which is available in all POSIX environments. However, it might get
# started with `bash` as the shell to support dotted.environment.variable.names which are not supported by POSIX, but
# are supported by `sh` in some Linux flavours.
Expand Down Expand Up @@ -75,27 +93,9 @@ if [ -n "$USE_SYSTEM_CA_CERTS" ]; then
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the
# system location, for whatever reason.
if [ -d /certificates ] && [ "$(ls -A /certificates 2>/dev/null)" ]; then

# UBI
if [ -d /usr/share/pki/ca-trust-source/anchors/ ]; then
cp -La /certificates/* /usr/share/pki/ca-trust-source/anchors/
fi

# Ubuntu/Alpine
if [ -d /usr/local/share/ca-certificates/ ]; then
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
fi

# UBI
if command -v update-ca-trust >/dev/null; then
update-ca-trust
fi

# Ubuntu/Alpine
if command -v update-ca-certificates >/dev/null; then
update-ca-certificates
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
update-ca-certificates
else
# If we are not root, we cannot update the system truststore. That's bad news for tools like `curl` and `wget`,
# but since the JVM is the primary focus here, we can live with that.
Expand Down
2 changes: 1 addition & 1 deletion 11/jdk/ubi/ubi9-minimal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down
40 changes: 20 additions & 20 deletions 11/jdk/ubi/ubi9-minimal/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/usr/bin/env sh
# ------------------------------------------------------------------------------
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
#
# Licensed 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
#
# https://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.
#
# This script defines `sh` as the interpreter, which is available in all POSIX environments. However, it might get
# started with `bash` as the shell to support dotted.environment.variable.names which are not supported by POSIX, but
# are supported by `sh` in some Linux flavours.
Expand Down Expand Up @@ -75,27 +93,9 @@ if [ -n "$USE_SYSTEM_CA_CERTS" ]; then
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the
# system location, for whatever reason.
if [ -d /certificates ] && [ "$(ls -A /certificates 2>/dev/null)" ]; then

# UBI
if [ -d /usr/share/pki/ca-trust-source/anchors/ ]; then
cp -La /certificates/* /usr/share/pki/ca-trust-source/anchors/
fi

# Ubuntu/Alpine
if [ -d /usr/local/share/ca-certificates/ ]; then
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
fi

# UBI
if command -v update-ca-trust >/dev/null; then
update-ca-trust
fi

# Ubuntu/Alpine
if command -v update-ca-certificates >/dev/null; then
update-ca-certificates
cp -La /certificates/* /usr/share/pki/ca-trust-source/anchors/
fi
update-ca-trust
else
# If we are not root, we cannot update the system truststore. That's bad news for tools like `curl` and `wget`,
# but since the JVM is the primary focus here, we can live with that.
Expand Down
4 changes: 2 additions & 2 deletions 11/jdk/ubuntu/focal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -100,6 +100,6 @@ RUN set -eux; \
echo "java --version"; java --version; \
echo "Complete."
COPY entrypoint.sh /__cacert_entrypoint.sh
ENTRYPOINT ["/bin/bash", "/__cacert_entrypoint.sh"]
ENTRYPOINT ["/__cacert_entrypoint.sh"]

CMD ["jshell"]
42 changes: 21 additions & 21 deletions 11/jdk/ubuntu/focal/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
#
# Licensed 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
#
# https://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.
#
# This script defines `sh` as the interpreter, which is available in all POSIX environments. However, it might get
# started with `bash` as the shell to support dotted.environment.variable.names which are not supported by POSIX, but
# are supported by `sh` in some Linux flavours.
Expand Down Expand Up @@ -75,27 +93,9 @@ if [ -n "$USE_SYSTEM_CA_CERTS" ]; then
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the
# system location, for whatever reason.
if [ -d /certificates ] && [ "$(ls -A /certificates 2>/dev/null)" ]; then

# UBI
if [ -d /usr/share/pki/ca-trust-source/anchors/ ]; then
cp -La /certificates/* /usr/share/pki/ca-trust-source/anchors/
fi

# Ubuntu/Alpine
if [ -d /usr/local/share/ca-certificates/ ]; then
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
fi

# UBI
if command -v update-ca-trust >/dev/null; then
update-ca-trust
fi

# Ubuntu/Alpine
if command -v update-ca-certificates >/dev/null; then
update-ca-certificates
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
update-ca-certificates
else
# If we are not root, we cannot update the system truststore. That's bad news for tools like `curl` and `wget`,
# but since the JVM is the primary focus here, we can live with that.
Expand Down
4 changes: 2 additions & 2 deletions 11/jdk/ubuntu/jammy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -100,6 +100,6 @@ RUN set -eux; \
echo "java --version"; java --version; \
echo "Complete."
COPY entrypoint.sh /__cacert_entrypoint.sh
ENTRYPOINT ["/bin/bash", "/__cacert_entrypoint.sh"]
ENTRYPOINT ["/__cacert_entrypoint.sh"]

CMD ["jshell"]
42 changes: 21 additions & 21 deletions 11/jdk/ubuntu/jammy/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
#
# Licensed 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
#
# https://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.
#
# This script defines `sh` as the interpreter, which is available in all POSIX environments. However, it might get
# started with `bash` as the shell to support dotted.environment.variable.names which are not supported by POSIX, but
# are supported by `sh` in some Linux flavours.
Expand Down Expand Up @@ -75,27 +93,9 @@ if [ -n "$USE_SYSTEM_CA_CERTS" ]; then
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the
# system location, for whatever reason.
if [ -d /certificates ] && [ "$(ls -A /certificates 2>/dev/null)" ]; then

# UBI
if [ -d /usr/share/pki/ca-trust-source/anchors/ ]; then
cp -La /certificates/* /usr/share/pki/ca-trust-source/anchors/
fi

# Ubuntu/Alpine
if [ -d /usr/local/share/ca-certificates/ ]; then
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
fi

# UBI
if command -v update-ca-trust >/dev/null; then
update-ca-trust
fi

# Ubuntu/Alpine
if command -v update-ca-certificates >/dev/null; then
update-ca-certificates
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
update-ca-certificates
else
# If we are not root, we cannot update the system truststore. That's bad news for tools like `curl` and `wget`,
# but since the JVM is the primary focus here, we can live with that.
Expand Down
4 changes: 2 additions & 2 deletions 11/jdk/ubuntu/noble/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -100,6 +100,6 @@ RUN set -eux; \
echo "java --version"; java --version; \
echo "Complete."
COPY entrypoint.sh /__cacert_entrypoint.sh
ENTRYPOINT ["/bin/bash", "/__cacert_entrypoint.sh"]
ENTRYPOINT ["/__cacert_entrypoint.sh"]

CMD ["jshell"]
42 changes: 21 additions & 21 deletions 11/jdk/ubuntu/noble/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
#
# Licensed 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
#
# https://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.
#
# This script defines `sh` as the interpreter, which is available in all POSIX environments. However, it might get
# started with `bash` as the shell to support dotted.environment.variable.names which are not supported by POSIX, but
# are supported by `sh` in some Linux flavours.
Expand Down Expand Up @@ -75,27 +93,9 @@ if [ -n "$USE_SYSTEM_CA_CERTS" ]; then
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the
# system location, for whatever reason.
if [ -d /certificates ] && [ "$(ls -A /certificates 2>/dev/null)" ]; then

# UBI
if [ -d /usr/share/pki/ca-trust-source/anchors/ ]; then
cp -La /certificates/* /usr/share/pki/ca-trust-source/anchors/
fi

# Ubuntu/Alpine
if [ -d /usr/local/share/ca-certificates/ ]; then
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
fi

# UBI
if command -v update-ca-trust >/dev/null; then
update-ca-trust
fi

# Ubuntu/Alpine
if command -v update-ca-certificates >/dev/null; then
update-ca-certificates
cp -La /certificates/* /usr/local/share/ca-certificates/
fi
update-ca-certificates
else
# If we are not root, we cannot update the system truststore. That's bad news for tools like `curl` and `wget`,
# but since the JVM is the primary focus here, we can live with that.
Expand Down
2 changes: 1 addition & 1 deletion 11/jdk/windows/nanoserver-1809/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion 11/jdk/windows/nanoserver-ltsc2022/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion 11/jdk/windows/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion 11/jdk/windows/windowsservercore-ltsc2022/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion 11/jre/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py"
# NOTE: THIS FILE IS GENERATED VIA "generate_dockerfiles.py"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
# ------------------------------------------------------------------------------
Expand Down
Loading
Loading