Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Update docker entrypoint to fail on error #1174

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env bash

SITE_PKG_DIR=${SITE_PKG_DIR:="$(python3 -c 'import site; print(site.getsitepackages())')"}
set -euo pipefail

if [[ "${SET_HOSTID_TO_HOSTNAME}" == "true" ]]; then
echo "Setting ANCHORE_HOST_ID to ${HOSTNAME}"
export ANCHORE_HOST_ID=${HOSTNAME}
fi

# check if /home/anchore/certs/ exists & has files in it
if [[ -d "/home/anchore/certs" ]] && [[ ! -z "$(ls -A /home/anchore/certs)" ]]; then
if [[ -d "/home/anchore/certs" ]] && [[ -n "$(ls -A /home/anchore/certs)" ]]; then
mkdir -p /home/anchore/certs_override/python
mkdir -p /home/anchore/certs_override/os
### for python
cp $SITE_PKG_DIR/certifi/cacert.pem /home/anchore/certs_override/python/cacert.pem
cp "$(python3 -m certifi)" /home/anchore/certs_override/python/cacert.pem
for file in /home/anchore/certs/*; do
if grep -q 'BEGIN CERTIFICATE' "${file}"; then
cat "${file}" >> /home/anchore/certs_override/python/cacert.pem
Expand Down