docker login
For reference I paste code:
sudo docker run -d --name jenkins-dind \
-p 8080:8080 -p 50000:50000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-u root \
-e DOCKER_GID=$(getent group docker | cut -d: -f3) \
jenkins/jenkins:lts
Jenkins in brower: http://127.0.0.1:8080/
Set up SonarCube in Docker
Instruction of SonarCube was from https://hub.docker.com/_/sonarqube
Run script below sudo is needed. Script without has error.
sysctl -w vm.max_map_count=524288
sysctl -w fs.file-max=131072
ulimit -n 131072
ulimit -u 8192
SonarCube with Docker
https://docs.sonarsource.com/sonarqube-server/latest/try-out-sonarqube/
$ sudodocker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
SonarCube logging page:
L: admin
P: admin
We build project:complete-cicd
Installation Trivy:
Command line to install Trivy in CLI:
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.62.1
Trivy documentation:
https://trivy.dev/latest/getting-started/installation/
https://www.cyberciti.biz/faq/how-to-install-curl-command-on-a-ubuntu-linux/
https://trivy.dev/v0.33/
Install AWS CLI:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Code for pipeline and simple app are in link to GitHub repo:
https://github.com/andsidor/Complete_CICD_02
My pipeline had step like below:
- Check SCM
- Install NodeJS
- Contect to github
- Run Test
- SonarQube analysis
- Docker build
- Trivy Scan
- Login to AWS ECR
- Push docker image to ECR

















No comments:
Post a Comment