Junior
What is your experience with Docker?
sobes.tech AI
Answer from AI
Over 5 years of active experience using Docker in various projects.
The experience includes:
- Developing Dockerfiles: Creating optimized and multi-stage Dockerfiles for building application images (web, microservices, databases, etc.).
- Managing images: Working with Docker Hub, private repositories (GitLab Registry, Nexus), tagging, versioning, cleaning up unused images.
- Working with containers: Running, stopping, restarting, monitoring status, viewing logs, executing commands inside containers (
docker exec). - Docker Compose: Using it to define and run multi-container applications, orchestrate services, manage networks and volumes.
- Docker networks: Understanding and configuring various network drivers (bridge, host, overlay), creating custom networks for service isolation.
- Docker volumes: Using named volumes and bind mounts for data persistence, file sharing between host and container.
- Docker security: Understanding container isolation basics, using rootless Docker (where possible), scanning images for vulnerabilities.
- CI/CD integration: Incorporating Docker image build and publish steps into CI/CD pipelines (Jenkins, GitLab CI, GitHub Actions).
- Orchestration (basic knowledge): General understanding of Kubernetes principles (deploying containers, pods, replication, services), experience running simple applications in minikube/Kind for testing.
Examples of Docker Compose usage:
# docker-compose.yaml
version: '3.8'
services:
app:
build: . # Build image from current directory
ports:
- "80:80" # Forward port 80 of host to port 80 of container
environment:
DATABASE_URL: postgres://user:password@db:5432/mydatabase # Environment variables
depends_on:
- db # Dependency on db service
db:
image: postgres:14 # Using the standard postgres image
volumes:
- db_data:/var/lib/postgresql/data # Persistent volume for data
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: mydatabase
volumes:
db_data: # Named volume definition