Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Commit 89246a9

Browse files
author
rfaircloth-splunk
committed
feat: Container as non root user
Update Dockerfile Update Dockerfile fix Update entrypoint.sh Update entrypoint.sh Update entrypoint.sh
1 parent f890582 commit 89246a9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
# limitations under the License.
1515
#
1616
FROM registry.access.redhat.com/ubi8/ubi
17+
RUN groupadd -g 1001 celery \
18+
&& useradd -m -u 1001 -g celery celery
1719

1820
RUN curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.13 sh
1921
ARG PYTHON_RUNTIME_VERSION=3.8
22+
2023
RUN cd /tmp ;\
2124
dnf install tzdata curl wget nc python${PYTHON_RUNTIME_VERSION} python3-pip procps-ng -y ;\
2225
dnf update -y ;\
@@ -27,4 +30,5 @@ COPY dist/*.whl /tmp
2730
RUN pip${PYTHON_RUNTIME_VERSION} install $(ls /tmp/*.whl); rm -f /tmp/*.whl
2831

2932
WORKDIR /work
33+
USER 1001
3034
ENTRYPOINT [ "/work/entrypoint.sh" ]

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ then
6060
sc4snmp-poller $@ &
6161
else
6262
echo starting sc4-snmp-worker
63-
celery -A splunk_connect_for_snmp_poller.manager.celery_client worker -l INFO -n worker1
63+
celery -A splunk_connect_for_snmp_poller.manager.celery_client worker -l INFO -n worker1 || exit 1
6464
fi
6565

6666
pid="$!"

0 commit comments

Comments
 (0)