Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. [Unit]
  2. Description=nginx
  3.  
  4. [Service]
  5. ExecStartPre=docker pull nginx
  6. ExecStart=docker run --name nginx --rm -p %1:80 nginx
  7. ExecStartPost=etcdctl set /services/nginx ${COREOS_PUBLIC_IPV4}:%i
  8. ExecStop=/usr/bin/docker kill nginx
  9. ExecStopPost=/usr/bin/etcdctl rm /services/nginx
  10.  
  11. # %i => substituido pelo valor após o @, no caso valor 80
  12. # ${COREOS_PUBLIC_IPV4} => IP público do servidor
  13.  
  14. # Registrar o service no cluster => fleetctl submit nginx.service
  15. # Iniciar o service em um host do cluster => fleetctl start nginx.service
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement