Skip to content

Commit

Permalink
use jinja templating to remove distro specific cases in entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Jul 25, 2024
1 parent 988228f commit c01ebb9
Show file tree
Hide file tree
Showing 48 changed files with 944 additions and 945 deletions.
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 DOCKERFILE 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
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 DOCKERFILE 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
40 changes: 20 additions & 20 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
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE 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
40 changes: 20 additions & 20 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
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE 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
40 changes: 20 additions & 20 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
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE 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
40 changes: 20 additions & 20 deletions 11/jre/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/usr/bin/env sh
# ------------------------------------------------------------------------------
# NOTE: THIS DOCKERFILE 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
40 changes: 20 additions & 20 deletions 11/jre/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 DOCKERFILE 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
Loading

0 comments on commit c01ebb9

Please sign in to comment.