Skip to content

Instantly share code, notes, and snippets.

@matt-baker
Last active May 23, 2017 20:29
Show Gist options
  • Save matt-baker/500f0215485c7057319b0603b4e99a52 to your computer and use it in GitHub Desktop.
Save matt-baker/500f0215485c7057319b0603b4e99a52 to your computer and use it in GitHub Desktop.
Docker service example
# Create Docker image
docker build --tag='your_image' .
# Create Docker service, default to 0 containers, set environment variable appropriately
docker service create --name service_etl --replicas 0 --e "action=etl" your_image # Run ETL example
docker service create --name service_analysis --replicas 0 --e "action=analysis" your_image # Run analysis example
# Scale as much as your infrastructure will handle
docker service scale service_etl=300
docker service scale service_analysis=300
# To scale down when you are done use
docker service scale service_etl=0
docker service scale service_analysis=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment