Skip to content

Commit

Permalink
Fix -startup script (#5)
Browse files Browse the repository at this point in the history
* Fix -startup script

* chmod fix

* use normal ubi image

---------

Co-authored-by: A <andrei.noga@sva.de>
  • Loading branch information
truestory1 and A authored Apr 25, 2024
1 parent c0999fd commit 2dd57fe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM registry.access.redhat.com/ubi8/ubi-init@sha256:d35aff7118921a3a2c2e78507fc7329b499b8fb09d290dc60a44eea6cdeb9b5c
FROM registry.access.redhat.com/ubi8/ubi

# Add repositories
COPY zscaler.repo /etc/yum.repos.d/

# Add startup script
COPY start.sh /start.sh

# Install packages and enable services
RUN yum -y install zpa-connector rsyslog && \
RUN yum -y install zpa-connector && \
yum clean all && \
systemctl enable zpa-connector rsyslog
chmod +x /start.sh

CMD [ "/sbin/init" ]
CMD [ "/start.sh" ]
21 changes: 21 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -e

chown -R zscaler /opt/zscaler
if [ ! -f "/opt/zscaler/var/provision_key" ]; then
echo "Adding provisioning key from environment"
echo ${ZPA_PROVISION_KEY} > /opt/zscaler/var/provision_key
fi

cd /opt/zscaler/var

ulimit -n 512000
arch=$(uname -m)

if [ "$arch" == 'aarch64' ] || [ ! -z "$LIMITED_MEM" ];
then
exec /opt/zscaler/bin/zpa-connector -memory_arena_count 1 -container "$@"
else
exec /opt/zscaler/bin/zpa-connector -container "$@"
fi

0 comments on commit 2dd57fe

Please sign in to comment.