github.com/didip/deis@v1.4.1/deisctl/units/deis-builder.service (about)

     1  [Unit]
     2  Description=deis-builder
     3  
     4  [Service]
     5  EnvironmentFile=/etc/environment
     6  TimeoutStartSec=30m
     7  ExecStartPre=/bin/sh -c "docker inspect deis-builder-data >/dev/null 2>&1 || docker run --name deis-builder-data -v /var/lib/docker ubuntu-debootstrap:14.04 /bin/true"
     8  ExecStartPre=/bin/sh -c "IMAGE=`/run/deis/bin/get_image /deis/builder` && docker history $IMAGE >/dev/null || docker pull $IMAGE"
     9  ExecStartPre=/bin/sh -c "docker inspect deis-builder >/dev/null && docker rm -f deis-builder || true"
    10  ExecStartPre=-/bin/sh -c "/sbin/losetup -f"
    11  ExecStart=/bin/sh -c "IMAGE=`/run/deis/bin/get_image /deis/builder` && docker run --name deis-builder --rm -p 2223:22 --volumes-from=deis-builder-data -c 800 -e EXTERNAL_PORT=2223 -e HOST=$COREOS_PRIVATE_IPV4 --privileged -v /etc/environment_proxy:/etc/environment_proxy $IMAGE"
    12  ExecStartPost=/bin/sh -c "echo 'Waiting for builder on 2223/tcp...' && until echo 'dummy-value' | ncat $COREOS_PRIVATE_IPV4 2223 >/dev/null 2>&1; do sleep 1; done"
    13  ExecStartPost=/usr/bin/docker exec deis-builder /usr/local/bin/push-images
    14  ExecStopPost=-/usr/bin/docker rm -f deis-builder
    15  Restart=on-failure
    16  RestartSec=5
    17  
    18  [Install]
    19  WantedBy=multi-user.target