garbage.nomad (590B)
1 job "garbage" { 2 datacenters = ["dc1"] 3 type = "sysbatch" 4 5 parameterized { 6 payload = "forbidden" 7 meta_required = ["job"] 8 } 9 10 group "garbage" { 11 count = 1 12 13 #restart { 14 # attempts = 1 15 # mode = "fail" 16 #} 17 18 network { 19 mode = "host" 20 } 21 22 task "docker" { 23 driver = "raw_exec" 24 25 config { 26 command = "/usr/bin/sh" 27 args = ["-c", "j=$(docker ps -f \"name=${NOMAD_META_JOB}*\" --format \"{{.ID}}\") && docker stop $j && docker rm $j"] 28 } 29 30 resources { 31 memory = 16 32 cpu = 100 33 } 34 } 35 } 36 }