mirror of
https://github.com/bitnami/containers.git
synced 2026-03-17 14:57:40 +08:00
2.0.0-debian-10-r22 release
This commit is contained in:
@@ -10,14 +10,14 @@ COPY prebuildfs /
|
||||
# Install required system packages and dependencies
|
||||
RUN install_packages acl ca-certificates curl gzip libc6 procps rpm tar
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "harbor-adapter-trivy" "2.0.0-1" --checksum d71b6cb9aab20375e91e9d82997703d4efe329e9df8d98491ccc7c5997fcd7b3
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.12.0-0" --checksum 582d501eeb6b338a24f417fededbf14295903d6be55c52d66c52e616c81bcd8c
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.12.0-1" --checksum 51cfb1b7fd7b05b8abd1df0278c698103a9b1a4964bdacd87ca1d5c01631d59c
|
||||
RUN apt-get update && apt-get upgrade -y && \
|
||||
rm -r /var/lib/apt/lists /var/cache/apt/archives
|
||||
|
||||
COPY rootfs /
|
||||
RUN /opt/bitnami/scripts/harbor-adapter-trivy/postunpack.sh
|
||||
ENV BITNAMI_APP_NAME="harbor-adapter-trivy" \
|
||||
BITNAMI_IMAGE_VERSION="2.0.0-debian-10-r21" \
|
||||
BITNAMI_IMAGE_VERSION="2.0.0-debian-10-r22" \
|
||||
PATH="/opt/bitnami/harbor-adapter-trivy/bin:/opt/bitnami/common/bin:$PATH"
|
||||
|
||||
WORKDIR /opt/bitnami/harbor-adapter-trivy
|
||||
|
||||
@@ -95,6 +95,22 @@ is_file_writable() {
|
||||
fi
|
||||
}
|
||||
|
||||
########################
|
||||
# Relativize a path
|
||||
# arguments:
|
||||
# $1 - path
|
||||
# $2 - base
|
||||
# returns:
|
||||
# None
|
||||
#########################
|
||||
relativize() {
|
||||
local -r path="${1:?missing path}"
|
||||
local -r base="${2:?missing base}"
|
||||
pushd / >/dev/null
|
||||
realpath -q --no-symlinks --relative-base="$base" "$path" | sed -e 's|^/$|.|' -e 's|^/||'
|
||||
popd >/dev/null
|
||||
}
|
||||
|
||||
########################
|
||||
# Configure permisions and ownership recursively
|
||||
# Globals:
|
||||
|
||||
@@ -36,16 +36,17 @@ persist_app() {
|
||||
return
|
||||
fi
|
||||
pushd "$install_dir" >/dev/null
|
||||
local file_to_persist_destination file_to_persist_destination_folder
|
||||
local file_to_persist_relative file_to_persist_destination file_to_persist_destination_folder
|
||||
local -r tmp_file="/tmp/perms.acl"
|
||||
for file_to_persist in "${files_to_persist[@]}"; do
|
||||
file_to_persist_destination="${persist_dir}/${file_to_persist}"
|
||||
file_to_persist_relative="$(relativize "$file_to_persist" "$install_dir")"
|
||||
file_to_persist_destination="${persist_dir}/${file_to_persist_relative}"
|
||||
file_to_persist_destination_folder="$(dirname "$file_to_persist_destination")"
|
||||
# Get original permissions (except for the root directory, to avoid issues with volumes)
|
||||
find "$file_to_persist" | grep -E -v '^\.$' | xargs getfacl -R > "$tmp_file"
|
||||
find "$file_to_persist_relative" | grep -E -v '^\.$' | xargs getfacl -R > "$tmp_file"
|
||||
# Copy directories to the volume
|
||||
ensure_dir_exists "$file_to_persist_destination_folder"
|
||||
cp -Lr --preserve=links "$file_to_persist" "$file_to_persist_destination_folder"
|
||||
cp -Lr --preserve=links "$file_to_persist_relative" "$file_to_persist_destination_folder"
|
||||
# Restore permissions
|
||||
pushd "$persist_dir" >/dev/null
|
||||
if am_i_root; then
|
||||
@@ -84,11 +85,12 @@ restore_persisted_app() {
|
||||
warn "No persisted files are configured to be restored"
|
||||
return
|
||||
fi
|
||||
local file_to_restore_origin file_to_restore_destination
|
||||
local file_to_restore_relative file_to_restore_origin file_to_restore_destination
|
||||
for file_to_restore in "${files_to_restore[@]}"; do
|
||||
# We use realpath to ensure that the case of '.' is covered and the directory is removed
|
||||
file_to_restore_origin="$(realpath "${install_dir}/${file_to_restore}")"
|
||||
file_to_restore_destination="$(realpath "${persist_dir}/${file_to_restore}")"
|
||||
file_to_restore_relative="$(relativize "$file_to_restore" "$install_dir")"
|
||||
# We use 'realpath --no-symlinks' to ensure that the case of '.' is covered and the directory is removed
|
||||
file_to_restore_origin="$(realpath --no-symlinks "${install_dir}/${file_to_restore_relative}")"
|
||||
file_to_restore_destination="$(realpath --no-symlinks "${persist_dir}/${file_to_restore_relative}")"
|
||||
rm -rf "$file_to_restore_origin"
|
||||
ln -sfn "$file_to_restore_destination" "$file_to_restore_origin"
|
||||
done
|
||||
|
||||
@@ -45,7 +45,7 @@ Non-root container images add an extra layer of security and are generally recom
|
||||
Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/).
|
||||
|
||||
|
||||
* [`2-debian-10`, `2.0.0-debian-10-r21`, `2`, `2.0.0`, `latest` (2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-harbor-adapter-trivy/blob/2.0.0-debian-10-r21/2/debian-10/Dockerfile)
|
||||
* [`2-debian-10`, `2.0.0-debian-10-r22`, `2`, `2.0.0`, `latest` (2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-harbor-adapter-trivy/blob/2.0.0-debian-10-r22/2/debian-10/Dockerfile)
|
||||
|
||||
Subscribe to project updates by watching the [bitnami/harbor-adapter-trivy GitHub repo](https://github.com/bitnami/bitnami-docker-harbor-adapter-trivy).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user