Jenkins on AWS + Docker
These articles are AI-generated summaries. Please check the original sources for full details.
Jenkins na AWS + Docker
William Scussel, a DevOps leader at InnSpire.dev, details a stable Jenkins + Docker + AWS setup using a t3a.medium instance with 2vCPU and 4GB RAM, hosting 21 containers. The configuration includes isolated Jenkins instances and Docker.sock integration for container control.
Why This Matters
Jenkins’ complexity often leads to pipeline failures and data loss, but this setup mitigates risks through Docker isolation and AWS scalability. The t3a.medium instance demonstrates cost-effective resource use, avoiding overprovisioning while maintaining 21 containers without performance degradation.
Key Insights
- “21 containers running on a t3a.medium instance”: Contextualized in the blog post’s infrastructure setup.
- “Docker.sock mapping for container control”: Enables Jenkins to restart containers directly, critical for automated workflows.
- “Separate Jenkins instances for isolated team environments”: Facilitates parallel development without cross-team interference.
Working Example
# docker-compose.yml
services:
jenkins:
build: .
container_name: jenkins-innova
restart: always
privileged: true
ports:
- "3001:8080"
- "50000:50000"
volumes:
- jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
networks:
- innova-network
jenkins-innova-agent:
image: jenkins/inbound-agent
container_name: jenkins-innova-agent
networks:
- innova-network
volumes:
- /srv/jenkins-innova:/home/jenkins/agent-workspace
- /var/run/docker.sock:/var/run/docker.sock
environment:
JENKINS_URL: "http://jenkins-innova:8080"
JENKINS_AGENT_NAME: "agent"
JENKINS_SECRET: "chave"
restart: unless-stopped
volumes:
jenkins_home:
networks:
innova-network:
external: true
# Dockerfile
FROM jenkins/jenkins:alpine3.21-jdk21
USER root
RUN apk add --no-cache \
sudo \
docker-cli \
git \
bash \
curl \
ttf-dejavu
RUN addgroup -S docker && adduser jenkins docker \
&& echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
USER jenkins
Practical Applications
- Use Case: DevOps teams using Jenkins + Docker on AWS for isolated CI/CD pipelines.
- Pitfall: Overlooking Docker.sock security risks leading to container control vulnerabilities.
References:
Continue reading
Next article
🛡️ Laravel Secure Baseline: The Guardian Your Pipeline Deserves
Related Content
Zero-Downtime CI/CD for 100K+ Daily Requests with Blue-Green Deployments
Zero-downtime CI/CD for 100K+ daily requests using Blue-Green deployments with GitHub Actions, Docker, and Nginx.
Production-Ready AWS VPC Architecture: A 5-Tier Terraform Implementation Guide
Implement a high-availability AWS VPC using a 5-tier subnet strategy and Terraform to optimize costs and ensure network isolation for enterprise workloads.
Guide to Installing Terraform and Configuring AWS for Infrastructure Automation
A technical guide to setting up HashiCorp Terraform and AWS CLI on Linux, covering IAM configuration and VS Code integration for cloud architects.