3 # Docker Building Script. Reads all the components generated by install, on per-version basis
5 # Pull in Variables from d.props
6 if [ ! -e ./d.props ]; then
7 cp d.props.init d.props
12 DOCKER=${DOCKER:=docker}
14 echo "Building Containers for aaf components, version $VERSION"
16 # AAF_cass now needs a version...
17 cd ../auth-cass/docker
21 # Create the AAF Config (Security) Images
23 cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin
24 cp -Rf ../conf/CA sample
26 # AAF Config image (for AAF itself)
27 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile
28 $DOCKER build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
29 $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION}
30 $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/latest
32 cp ../cadi/servlet-sample/target/aaf-cadi-servlet-sample-${VERSION}-sample.jar sample/bin
33 # AAF Agent Image (for Clients)
34 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile
35 $DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample
36 $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION}
37 $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest
40 rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar sample/bin/aaf-cadi-servlet-sample-${VERSION}-sample.jar
45 # Second, build a core Docker Image
46 echo Building aaf_$AAF_COMPONENT...
47 # Apply currrent Properties to Docker file, and put in place.
48 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
50 $DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
51 $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION}
52 $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:latest
53 rm aaf_${VERSION}/Dockerfile
57 # Do all the Containers related to AAF Services
60 AAF_COMPONENTS=$(ls ../aaf_${VERSION}/bin | grep -v '\.')
65 mkdir -p ../aaf_${VERSION}/pod
66 cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/pod
67 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
68 echo Building aaf_$AAF_COMPONENT...
69 sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
71 $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
72 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
73 $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:latest
74 rm aaf_${VERSION}/Dockerfile
78 rm ../aaf_${VERSION}/pod/*
79 rmdir ../aaf_${VERSION}/pod