Docker Stack: DevOps
-
This is a docker stack of the following docker images:
-
First install the cifs-utils package (your system may already have this installed):
sudo dnf install cifs-utils -
Create a
docker-devops-stackdirectory. The rest of the document will reference this directory. -
All data for these docker services will be stored here so be mindful of space constraints.
This directory can be created in your home directory or any other directory that can grow to a few GBs in size.
-
Create various directories for the docker containers:
-
Change directory to the root of where you want to store the docker data files.
cd /home/mattosd -
Make folder for docker data.
mkdir -p docker-devops-stackIn this example the docker project directory will be
/home/mattosd/docker-devops-stack
-
-
Update folder permissions:
chmod 777 -R docker-devops-stack -
Use a docker-compose file to start all services.
-
Within the
docker-devops-stackfolder, create adocker-compose.ymlfile with the following contents:version: '3.7' services: jenkins: image: jenkins/jenkins:lts container_name: My-Jenkins privileged: true user: root ports: - 8081:8080 - 50000:50000 volumes: - ./jenkins:/var/jenkins_home - /var/run/docker.sock:/var/run/docker.sock - /usr/local/bin/docker:/usr/local/bin/docker # https://www.howtogeek.com/devops/how-to-deploy-a-gitlab-server-with-docker/ gitlab: image: 'gitlab/gitlab-ce:latest' container_name: My-GitLab restart: always hostname: sourcecontrol.xackleystudio.com ports: - '2224:22' - '8929:80' - '8443:443' environment: - TZ=America/New_York volumes: - ./GitLab/config:/etc/gitlab' - ./GitLab/logs:/var/log/gitlab' - ./GitLab/data:/var/opt/gitlab' shm_size: '256m' -
Start the containers:
cd docker-devops-stack sudo docker-compose up -dThe initial build of Gitlab will take a long while to start.
-
-
Open FW ports
-
Jenkins: 8081:
-
-
Navigate to the container web pages:
-
Jenkins
-
Browse here
http://localhost:8081 -
Retrieve the initial password via:
sudo docker exec My-Jenkins cat /var/jenkins_home/secrets/initialAdminPassword
-
-
GitLab
-
Browse here
https://v-ubuntu-devops:8989/users/sign_in -
Retrieve the initial password via:
sudo docker exec -it My-GitLab grep 'Password:' /etc/gitlab/initial_root_password
-
-