diff options
author | 2025-01-30 19:28:37 +0530 | |
---|---|---|
committer | 2025-01-30 19:28:37 +0530 | |
commit | d41e1b68b6be32ee367bdadd37955e91fba21303 (patch) | |
tree | 3faf15cbbc209a6f381c328c5baeaf684122d66b /asdctool/sdc-cassandra-init/Dockerfile | |
parent | 92c86bb2b390a9d74f84d53b3edeccd239f3f0f5 (diff) |
Chef removal changes for asdc_tool
- Removal of Chef recipes in the module.
- Introduction of shell scripts in the module to replace some recipes.
- Generation of module configuration using Charts.
Issue-ID: SDC-4699
Change-Id: I3bb3b275f01cb35fb25ada0df3f9c65b86bac106
Signed-off-by: Jinendra.Lodha <jinendra.lodha@accenture.com>
Diffstat (limited to 'asdctool/sdc-cassandra-init/Dockerfile')
-rw-r--r-- | asdctool/sdc-cassandra-init/Dockerfile | 84 |
1 files changed, 47 insertions, 37 deletions
diff --git a/asdctool/sdc-cassandra-init/Dockerfile b/asdctool/sdc-cassandra-init/Dockerfile index 2ac8a7b96f..dd31cc5f4c 100644 --- a/asdctool/sdc-cassandra-init/Dockerfile +++ b/asdctool/sdc-cassandra-init/Dockerfile @@ -1,45 +1,55 @@ -FROM onap/policy-jdk-alpine:2.4.4 - -USER root - -# Add 'sdc' user +FROM onap/policy-jdk-debian:2.0.2 + +# Create a new group and user RUN addgroup sdc && \ adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc - + USER sdc - -# Configure CQLSH + +# Create Cassandra configuration directory and file RUN mkdir -p ~/.cassandra/ && \ echo '[cql]' > ~/.cassandra/cqlshrc && \ echo 'version=3.4.4' >> ~/.cassandra/cqlshrc - -USER root - -# 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 - -# Set entrypoint + +# Update package list and install necessary packages +RUN apt-get update --allow-releaseinfo-change && \ + apt-get purge python* -y && \ + apt-get install -y python3-pip && \ + python3 -m pip install --upgrade pip && \ + pip3 install cqlsh==6.1.0 && \ + mkdir -p ~/.cassandra/ && \ + echo '[cql]' > ~/.cassandra/cqlshrc && \ + echo 'version=3.4.4' >> ~/.cassandra/cqlshrc && \ + apt-get install -y \ + libffi-dev \ + libxml2-dev && \ + apt-get clean + +# Remove bash only if absolutely necessary +RUN apt-get remove bash -y --allow-remove-essential || true + USER sdc -ENTRYPOINT [ "/home/sdc/startup.sh" ]
\ No newline at end of file + +# Copy sdctool tar and startup +COPY --chown=sdc:sdc sdctool.tar /home/sdc/sdctool.tar +COPY --chown=sdc:sdc scripts /home/sdc/scripts +COPY --chown=sdc:sdc startup.sh /home/sdc + +# Extract and prepare sdctool +RUN tar -xvf /home/sdc/sdctool.tar -C /home/sdc && \ + rm /home/sdc/sdctool.tar && \ + mkdir -p /home/sdc/tools && \ + cp -pr /home/sdc/sdctool/tools/* /home/sdc/tools && \ + chmod +x /home/sdc/sdctool/scripts/* && \ + chmod +x /home/sdc/tools/build/scripts/* && \ + chmod +x /home/sdc/tools/scripts/* && \ + chown -R sdc:sdc /home/sdc/tools/build/scripts/* && \ + chmod +x /home/sdc/startup.sh && \ + chmod +x /home/sdc/scripts/* && \ + cp -r /home/sdc/scripts/janusgraph.properties /home/sdc/sdctool/config && \ + cp -r /home/sdc/scripts/configuration.yaml /home/sdc/sdctool/config + +# Define entrypoint +ENTRYPOINT [ "sh", "-c", "/home/sdc/startup.sh" ] |