ubuntu@ip-172-31-27-130:~$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eaca94ffc84f jenkins/jenkins:lts "/usr/bin/tini -- /u…" 25 minutes ago Up About a minute 0.0.0.0:8080->8080/tcp, :::8080->8080/
# if jenkins is down, because is a t.micro instance
# ssh into the server and start the container
# https://us-east-2.console.aws.amazon.com/ec2/home?region=us-east-2#ConnectToInstance:instanceId=i-0d1ae716c8bc46b24
# you need to have the key to be able to ssh into this machine
$~ ssh -i "stefano-us-east-2.pem" ubuntu@ec2-3-129-62-248.us-east-2.compute.amazonaws.com
$~ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eaca94ffc84f jenkins/jenkins:lts "/usr/bin/tini -- /u…" 2 days ago Exited (255) 9 hours ago 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:50000->50000/tcp, :::50000->50000/tcp elated_galileo
$~ sudo docker start eaca94ffc84f
# under normai circustances Jenkins should be up and running,
# `sudo systemctl enable docker`
# just to make sure that added to to systemctl and will restart
Push code to GitHub
Jenkins job triggers
Code testing ( we can use Teamcity )
If all tests pass then Jenkins job builds the Docker image and pushes it to our Docker Hub
On our server we run periodic checks with cronjobs, ECR ( Elastic Container Registry ) where there we keep another copy of the update Docker image for failove scenarios explained earlier on Application Pipeline.