Command Line Only
After modifying your host file, Add docker.acme.com and docker-private.acme.com as insecure registries in docker desktop and restart docker desktop.
127.0.0.1 nexus.acme.com
127.0.0.1 docker.acme.com
127.0.0.1 docker-private.acme.com
127.0.0.1 bitbucket.acme.com
127.0.0.1 sonarqube.acme.com
Git access coming soon.
#clone our repo
git clone https://scm-labs.spirebase.com/scm/labs/cicd.git
cd cicd
##################################
## SEED BUILD
##################################
# build images
docker-compose -f seed/ubuntu-focal/docker-compose.yml build
docker-compose -f seed/openjdk-8/docker-compose.yml build
docker-compose -f seed/nexus/docker-compose.yml build
docker-compose -f seed/nexus-init/docker-compose.yml build
docker-compose -f seed/nexus-dml/docker-compose.yml build
# build network first
docker network create --driver=bridge --subnet=172.22.90.0/16 --gateway=172.22.0.1 ops-network
# starts it in background
docker-compose -f composed/docker-compose-seed.yml up --no-start
docker-compose -f composed/docker-compose-seed.yml start
# start nexus3 with side cars (process will wait until nexus3 is started)
docker-compose -f composed/docker-compose-seed-init.yml up
docker-compose -f composed/docker-compose-seed-dml.yml up
##################################
## INFRA RE-BUILD
##################################
# rebuild base image
mkdir images/ubuntu-focal/local/
curl http://admin:admin123@localhost:8081/repository/dml/docker/ubuntu/focal/20210827/ubuntu-focal-oci-amd64-root.tar.gz -o images/ubuntu-focal/local/ubuntu-focal-oci-amd64-root.tar.gz
docker-compose -f images/ubuntu-focal/docker-compose.yml build
rm -rf images/ubuntu-focal/local/
# build our nginx build proxy and injct the config with admin:admin123 base64
docker-compose -f images/nginx-build/docker-compose.yml build
sed -e "s|BASE64_USER_PASSWORD|YWRtaW46YWRtaW4xMjM=|" composed/nginx/build.conf.base > composed/nginx/build.conf
docker-compose -f composed/docker-compose-nginx-build.yml up --no-start
docker-compose -f composed/docker-compose-nginx-build.yml start
# rebuild and add nginx
docker-compose -f images/openjdk-8/docker-compose.yml build
docker-compose -f images/nexus/docker-compose.yml build
docker-compose -f images/nginx-base/docker-compose.yml build
docker-compose -f tools/ssl-cert/docker-compose.yml build
# stop the seed
docker-compose -f composed/docker-compose-seed.yml stop
# generate wildcard cert
docker-compose -f composed/docker-compose-ssl-cert-wildcard.yml up
# start nexus
docker-compose -f composed/docker-compose-nexus.yml up --no-start
docker-compose -f composed/docker-compose-nexus.yml start
# start behind nginx
docker-compose -f composed/docker-compose-nginx-nexus.yml up --no-start
docker-compose -f composed/docker-compose-nginx-nexus.yml start
# check logs until started
docker-compose -f composed/docker-compose-nexus.yml logs -f --tail="50"
##################################
## PUBLISH IMAGES
##################################
docker login docker-private.acme.com
images/docker-push.sh infra/ubuntu/focal:1.0.0 docker-private.acme.com
images/docker-push.sh infra/java/openjdk-8:1.0.0 docker-private.acme.com
images/docker-push.sh infra/sonatype/nexus3:1.0.0 docker-private.acme.com
images/docker-push.sh infra/nginx/build:1.0.0 docker-private.acme.com
images/docker-push.sh infra/nginx/base:1.0.0 docker-private.acme.com
You can now navigate to https://nexus.acme.com for a fully installed, configured and populated Nexus3.
docker-compose -f images/nexus-dml/docker-compose.yml build
docker-compose -f composed/docker-compose-dml.yml up
images/docker-push.sh infra/dml:1.0.0 docker-private.acme.com
docker-compose -f images/openjdk-11/docker-compose.yml build
docker-compose -f images/openjdk-12/docker-compose.yml build
images/docker-push.sh infra/java/openjdk-11:1.0.0 docker-private.acme.com
images/docker-push.sh infra/java/openjdk-12:1.0.0 docker-private.acme.com
DML fully populated and base images build.
# db related images
docker-compose -f images/db-script-sqlserver/docker-compose.yml build
docker-compose -f images/sqlserver/docker-compose.yml build
images/docker-push.sh infra/db-script-sqlserver:1.0.0 docker-private.acme.com
images/docker-push.sh infra/mssql/2019:1.0.0 docker-private.acme.com
# optional postgres images
docker-compose -f images/db-script-postgres/docker-compose.yml build
docker-compose -f images/postgres/docker-compose.yml build
images/docker-push.sh infra/db-script-postgres:1.0.0 docker-private.acme.com
images/docker-push.sh infra/postgres/13:1.0.0 docker-private.acme.com
# start DB
docker-compose -f composed/docker-compose-sqlserver.yml up --no-start
docker-compose -f composed/docker-compose-sqlserver.yml start
# bitbucket starting point: add your license key
sed -e "s|BITBUCKET_LICENSE|YOUR-LICENSE-HERE|" images/bitbucket/bitbucket.properties.base > images/bitbucket/bitbucket.properties
#build the images
docker-compose -f images/bitbucket-proxy-init/docker-compose.yml build
docker-compose -f images/bitbucket/docker-compose.yml build
# push the bitbucket
images/docker-push.sh infra/atlassian/bitbucket:1.0.0 docker-private.acme.com
# db creation
docker-compose -f composed/docker-compose-bitbucket-sqlserver-init.yml up
# first start, wait until the login screen appears and then stop this process
docker-compose -f composed/docker-compose-bitbucket-init.yml up
# fix the props file to make sure it can run behind nginx
docker-compose -f composed/docker-compose-bitbucket-proxy-init.yml up
# now start it up so we can put it behind nginx
docker-compose -f composed/docker-compose-bitbucket.yml up --no-start
docker-compose -f composed/docker-compose-bitbucket.yml start
# stop the nexusnginx and start the combined one
docker-compose -f composed/docker-compose-nginx-nexus.yml stop
docker-compose -f composed/docker-compose-nginx-nexus-bitbucket.yml up --no-start
docker-compose -f composed/docker-compose-nginx-nexus-bitbucket.yml start
You can now navigate to https://bitbucket.acme.com for a fully installed, configured Bitbucket. Next is Jenkins installation.
docker-compose -f images/jenkins/docker-compose.yml build
images/docker-push.sh infra/jenkins:1.0.0 docker-private.acme.com
mkdir -p composed/secrets/jenkins-passwords
echo 'admin123' > composed/secrets/jenkins-passwords/scm-pwd.txt
echo 'admin123' > composed/secrets/jenkins-passwords/artifacts-pwd.txt
# jenkins base install, feel free to test it out
#docker-compose -f composed/docker-compose-jenkins-base.yml up --force-recreate
# test project
docker-compose -f tools/bitbucket-helloworld/docker-compose.yml build
docker-compose -f tools/bitbucket-helloworld/docker-compose.yml up
docker-compose -f images/jenkins-job-pipeline/docker-compose.yml build
images/docker-push.sh infra/jenkins-job-pipeline:1.0.0 docker-private.acme.com
# automated build of test project and publish to nexus3, feel free to test
#docker-compose -f composed/docker-compose-jenkins-job-pipeline.yml up --force-recreate
docker-compose -f images/jenkins-job-pipeline-docker/docker-compose.yml build
docker-compose -f images/dind/docker-compose.yml build
images/docker-push.sh infra/jenkins-job-pipeline-docker:1.0.0 docker-private.acme.com
images/docker-push.sh infra/docker/dind:1.0.0 docker-private.acme.com
sed -e "s|BASE64_USER_PASSWORD|YWRtaW46YWRtaW4xMjM=|" composed/docker/config.json.base > composed/docker/config.json.tmp
# automated docker builds of test project, feel free to add
#docker-compose -f composed/docker-compose-jenkins-job-pipeline-docker.yml up --force-recreate
Jenkins projects ready for usage, next is Sonarqube. Sonarqube will leverage jenkins as well.
docker-compose -f images/sonarqube/docker-compose.yml build
images/docker-push.sh infra/sonarqube:1.0.0 docker-private.acme.com
# buuild ssl images for use later
docker-compose -f tools/ssl-cert-san/docker-compose.yml build
docker-compose -f tools/ssl-cacerts/docker-compose.yml build
# init the db
docker-compose -f composed/docker-compose-sonarqube-sqlserver-init.yml up
# first install of sonarqube
# If you run into issues and errors during startup for elasticsearch, please go directly
# to sonarqube lab for more information
# wait until completed with [SonarQube is up] message then stop
docker-compose -f composed/docker-compose-sonarqube.yml up
# fix the pwd
docker-compose -f composed/docker-compose-sonarqube-sqlserver-post-init.yml up
# generate ssl certs
docker-compose -f composed/docker-compose-ssl-cert-san-sonarqube.yml up
docker-compose -f composed/docker-compose-ssl-cacerts-sonarqube.yml up
# start up sonarqube
docker-compose -f composed/docker-compose-sonarqube.yml up --no-start
docker-compose -f composed/docker-compose-sonarqube.yml start
# replace nginx with sonarqube add on
docker-compose -f composed/docker-compose-nginx-nexus-bitbucket.yml stop
docker-compose -f composed/docker-compose-nginx-nexus-bitbucket-sonarqube.yml up --no-start
docker-compose -f composed/docker-compose-nginx-nexus-bitbucket-sonarqube.yml start
# wait until all apps are started first
docker-compose -f tools/sonarqube-helloworld/docker-compose.yml build
docker-compose -f tools/sonarqube-helloworld/docker-compose.yml up
docker-compose -f images/jenkins-job-pipeline-sonarqube/docker-compose.yml build
images/docker-push.sh infra/jenkins-job-pipeline-sonarqube:1.0.0 docker-private.acme.com
echo 'admin123' > composed/secrets/jenkins-passwords/sonar-pwd.txt
# automated build of test project and publish to sonarqube, feel free to use it
#docker-compose -f composed/docker-compose-jenkins-job-pipeline-sonarqube.yml up --force-recreate