aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/sdc-cassandra-init/Dockerfile
diff options
context:
space:
mode:
authorKhantwal <anamika.khantwal@accenture.com>2025-01-29 11:43:27 +0530
committerAnamika Khantwal <anamika.khantwal@accenture.com>2025-01-29 11:46:54 +0000
commit92c86bb2b390a9d74f84d53b3edeccd239f3f0f5 (patch)
tree25f54a34fcc7098a83179acc75c3fdf5e3869662 /asdctool/sdc-cassandra-init/Dockerfile
parentbbcddaafb6667c51af97a0d19d43b91f01b4025c (diff)
Chef removal changes from catalog-fe
- Removed chef from catalog-fe module with kubernetes resources. Issue-ID: SDC-4699 Change-Id: If599ea2136bb8dd98a816a9961f25ef0a4c39e25 Signed-off-by: Anamika Khantwal <anamika.khantwal@accenture.com>
Diffstat (limited to 'asdctool/sdc-cassandra-init/Dockerfile')
-rw-r--r--asdctool/sdc-cassandra-init/Dockerfile70
1 files changed, 36 insertions, 34 deletions
diff --git a/asdctool/sdc-cassandra-init/Dockerfile b/asdctool/sdc-cassandra-init/Dockerfile
index 6266e28f67..2ac8a7b96f 100644
--- a/asdctool/sdc-cassandra-init/Dockerfile
+++ b/asdctool/sdc-cassandra-init/Dockerfile
@@ -1,43 +1,45 @@
FROM onap/policy-jdk-alpine:2.4.4
-
+
USER root
-RUN addgroup sdc
-RUN adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc
+
+# Add 'sdc' user
+RUN addgroup sdc && \
+ adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc
+
USER sdc
-RUN mkdir ~/.cassandra/ && \
- echo '[cql]' > ~/.cassandra/cqlshrc && \
- echo 'version=3.4.4' >> ~/.cassandra/cqlshrc
+
+# Configure CQLSH
+RUN mkdir -p ~/.cassandra/ && \
+ echo '[cql]' > ~/.cassandra/cqlshrc && \
+ echo 'version=3.4.4' >> ~/.cassandra/cqlshrc
+
USER root
-
-RUN apk update && \
- python3 -m pip install --upgrade pip && \
- pip3 install cqlsh==6.1.0 && \
- mkdir ~/.cassandra/ && \
- echo '[cql]' > ~/.cassandra/cqlshrc && \
- echo 'version=3.4.4' >> ~/.cassandra/cqlshrc && \
- set -ex && \
- apk add --no-cache \
- wget \
- build-base \
- ruby \
- ruby-dev \
- libffi-dev \
- libressl-dev \
- libxml2-dev && \
- gem install --no-update-sources \
- rspec-its:1.3.0 hitimes:1.3.1 public_suffix:5.1.1 multipart-post:2.4.1 etc:1.4.3 bundler:2.4.22 chef:14.15.6 \
- faraday:2.8.1 minitar:0.12.1 berkshelf:7.0.10 \
- io-console:0.7.2 \
- webrick \
- json \
- --no-document && \
- gem cleanup
-
+
+# Install dependencies
+RUN apk update && apk add --no-cache \
+ python3 py3-pip wget build-base ruby ruby-dev libffi-dev openssl-dev libxml2-dev
+
+# Upgrade pip and install cqlsh
+RUN python3 -m pip install --upgrade pip && pip3 install cqlsh==6.1.0
+
+# Install required Ruby gems
+RUN gem install --no-document \
+ rspec-its:1.3.0 hitimes:1.3.1 public_suffix:5.1.1 multipart-post:2.4.1 etc:1.4.3 \
+ bundler:2.4.22 mixlib-log:3.1.1 chef:14.15.6 faraday:2.8.1 minitar:0.12.1 berkshelf:7.0.10 \
+ io-console:0.7.2 webrick json
+
+RUN gem cleanup
+
+# Copy required files
USER sdc
COPY --chown=sdc:sdc chef-solo /home/sdc/chef-solo/
COPY --chown=sdc:sdc chef-repo/cookbooks /home/sdc/chef-solo/cookbooks/
COPY --chown=sdc:sdc startup.sh /home/sdc/
-
+
+# Set permissions
+USER root
RUN chmod 770 /home/sdc/startup.sh
-
-ENTRYPOINT [ "/home/sdc/startup.sh" ]
+
+# Set entrypoint
+USER sdc
+ENTRYPOINT [ "/home/sdc/startup.sh" ] \ No newline at end of file