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
Provisioning AWS Networking with Terraform: A Hands-on Infrastructure as Code Guide
Learn to build a production-ready AWS VPC using Terraform to automate networking with public and private subnets, supporting up to 65,536 addresses.
Optimizing Cloud Economics: Why AWS Service Billing Fails Feature-Level Attribution
Learn how Arpit Gupta's team resolved a $180K monthly AWS bill crisis by implementing feature-level attribution and structured logging to identify a $34K compute cost spike.
Building a Serverless Scanner to Detect and Manage Zombie AWS Resources
Roberto Belotti developed aws-zombie-hunter, a container-based Lambda that identifies orphaned AWS resources across seven categories to reduce wasted cloud spend.