# Always need startup status...
if [ ! -e "$DIR" ]; then
mkdir -p "$DIR"
+ chmod 777 $DIR
fi
function status {
# Startup like normal
echo "Cassandra Startup"
- /usr/local/bin/docker-entrypoint.sh
+ exec /usr/local/bin/docker-entrypoint.sh
;;
wait)
# Wait for initialization. This can be called from Docker only as a check to make sure it is ready
# Startup like normal
echo "Cassandra Startup"
- /usr/local/bin/docker-entrypoint.sh
+ exec /usr/local/bin/docker-entrypoint.sh
;;
esac
COPY aaf-auth-batch-${AAF_VERSION}-full.jar /opt/app/aaf/cass_init/
COPY cass_data/*.dat /opt/app/aaf/cass_init/dats/
+RUN mkdir -p /opt/app/aaf/status && chmod 777 /opt/app/aaf/status
+#RUN addgroup ${USER} && adduser --no-create-home --ingroup ${USER} --disabled-password --gecos "" --shell /bin/bash ${USER}
+#RUN chown -R ${USER}:${USER} /opt/app/aaf/cass_init
+
+
ENTRYPOINT ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh"]
CMD ["start"]
# Default is to start up with CQL setup only
+++ /dev/null
-#!/bin/bash
-#########
-# ============LICENSE_START====================================================
-# org.onap.aaf
-# ===========================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
-# ===========================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END====================================================
-#
-# Pull in AAF Env Variables from AAF install
-if [ -e ../../docker/d.props ]; then
- . ../../docker/d.props
-fi
-DOCKER=${DOCKER:-docker}
-
-$DOCKER exec -it aaf_cass bash
-
DIR=$(pwd)
cd ..
-sed -e 's/${AAF_VERSION}/'${VERSION}'/g' $DIR/Dockerfile.cass > Dockerfile
+sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
+ -e 's/${USER}/'${USER}'/g' \
+ $DIR/Dockerfile.cass > Dockerfile
cd ..
cp -Rf sample/cass_data auth-cass/cass_data
cp sample/data/sample.identities.dat auth-cass
if [ "`$DOCKER ps -a | grep aaf-cass`" == "" ]; then
echo "starting Cass from 'run'"
# NOTE: These HEAP Sizes are minimal. Not set for full organizations.
+ # --user ${USER} \
$DOCKER run \
--name aaf-cass \
-e HEAP_NEWSIZE=512M \
LABEL description="aaf_base"
RUN apk add --no-cache bash
RUN apk add --no-cache openssl
-RUN addgroup aaf && adduser aaf -G aaf -D -s /bin/bash
+RUN addgroup ${USER} && adduser ${USER} -G ${USER} -D -s /bin/bash
COPY bin/aaf-cadi-servlet-sample-*-sample.jar /opt/app/aaf_config/bin/
COPY cert/*trust*.b64 /opt/app/aaf_config/cert/
-RUN chown -R aaf:aaf /opt/app/aaf_config
+RUN chown -R ${USER}:${USER} /opt/app/aaf_config
CMD ["/bin/bash","-c","/opt/app/aaf_config/bin/agent.sh"]
COPY bin/aaf-auth-cmd-${AAF_VERSION}-full.jar /opt/app/aaf_config/bin/
COPY bin/aaf-auth-batch-${AAF_VERSION}-full.jar /opt/app/aaf_config/bin/
-RUN chown -R aaf:aaf /opt/app/aaf_config && mkdir /opt/app/osaaf && chown aaf:aaf /opt/app/osaaf
+RUN chown -R ${USER}:${USER} /opt/app/aaf_config
+RUN mkdir -p /opt/app/osaaf && chown ${USER}:${USER} /opt/app/osaaf
CMD ["/bin/bash","/opt/app/aaf_config/bin/agent.sh"]
CMD []
COPY bin /opt/app/aaf/bin
COPY theme /opt/app/aaf/theme
-RUN chown -R aaf:aaf /opt/app/aaf
+RUN chown -R ${USER}:${USER} /opt/app/aaf
LABEL version=${AAF_VERSION}
COPY bin/pod_wait.sh /opt/app/aaf/bin/
-RUN mkdir /opt/app/osaaf && chown aaf:aaf /opt/app/osaaf && chown -R aaf:aaf /opt/app/aaf/bin
+RUN mkdir -p /opt/app/osaaf && chown ${USER}:${USER} /opt/app/osaaf
+RUN mkdir -p /opt/app/aaf/status && chown ${USER}:${USER} /opt/app/aaf/status
+RUN chown -R ${USER}:${USER} /opt/app/aaf
#CMD ["bash","-c","cd /opt/app/aaf;bin/${AAF_COMPONENT}"]
CMD []
-v "aaf_status:/opt/app/aaf/status" \
$LINKS \
--env aaf_locator_container=docker \
+ --env aaf_locator_container_ns=${NAMESPACE} \
--env aaf_locator_fqdn=${HOSTNAME} \
--env aaf_locate_url=https://aaf-locate:8095 \
- --env aaf_locator_public_hostname=$HOSTNAME \
+ --env aaf_locator_public_hostname=${HOSTNAME} \
--env AAF_ENV=${AAF_ENV} \
--env LATITUDE=${LATITUDE} \
--env LONGITUDE=${LONGITUDE} \
# AAF Base version - set the core image, etc
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
+ -e 's/${USER}/'${USER}'/g' \
Dockerfile.base > Dockerfile
$DOCKER build -t ${ORG}/${PROJECT}/aaf_base:${VERSION} .
$DOCKER tag ${ORG}/${PROJECT}/aaf_base:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_base:${VERSION}
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
-e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
-e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
+ -e 's/${USER}/'${USER}'/g' \
docker/Dockerfile.config > sample/Dockerfile
$DOCKER build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
$DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
-e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
-e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
+ -e 's/${USER}/'${USER}'/g' \
docker/Dockerfile.client > sample/Dockerfile
$DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
$DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
-e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
-e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
+ -e 's/${USER}/'${USER}'/g' \
Dockerfile.core >../aaf_${VERSION}/Dockerfile
cd ..
$DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \
-e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \
-e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \
+ -e 's/${USER}/'${USER}'/g' \
Dockerfile.ms >../aaf_${VERSION}/Dockerfile
cd ..
$DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
#ADD_HOST="$ADD_HOST --add-host=$CASS_HOST"
#fi
#--hostname="${AAF_COMPONENT}.${NAMESPACE}" \
+ # --env aaf_locate_url=https://aaf-locate:8095 \
# $ADD_HOST \
$DOCKER run \
-d \
${LINKS} \
--env AAF_ENV=${AAF_ENV} \
--env aaf_locator_container=docker \
- --env aaf_locator_fqdn=$HOSTNAME \
+ --env aaf_locator_container_ns=${NAMESPACE} \
+ --env aaf_locator_fqdn=${HOSTNAME} \
+ --env aaf_locator_public_hostname=${HOSTNAME} \
--env LATITUDE=${LATITUDE} \
--env LONGITUDE=${LONGITUDE} \
--env CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER} \
for P in `env`; do
if [[ "$P" == aaf_locator* ]]; then
echo "$P" >> ${TMP}
- if [[ "$P" == aaf_locator_container=* ]]; then
- echo aaf_locator_container.hostname=${HOSTNAME} >> ${TMP}
- fi
fi
done
fi
NAME=aaf.bootstrap
-FQDN="${HOSTNAME:=$(hostname -f)}"
+HOSTNAME="${HOSTNAME:=$(hostname -)}"
+FQDN="${aaf_locator_fqdn:=$HOSTNAME}"
FQI=aaf@aaf.osaaf.org
SUBJECT="/CN=$FQDN/OU=$FQI`cat subject.aaf`"
SIGNER_P12=$1