$ cd /path/to/Dockerfile
$ sudo docker build .
View running processes
| #!/bin/bash | |
| CMD="curl --write-out %{http_code} --silent --output /dev/null http://169.254.169.254/latest/meta-data/spot/termination-time" | |
| while true | |
| do | |
| if [ "$(${CMD})" != "404" ]; then | |
| # 2 minute warning received. Do all your cleanup work. | |
| echo "2 minute termination warning. Draining nomad node..." | |
| nomad node-drain -yes -self -enable | |
| echo "Hasta la vista baby, I will be back" | |
| break |
| # Path to your oh-my-zsh installation. | |
| export ZSH=/Users/dimitar.danailov/.oh-my-zsh | |
| # Set name of the theme to load. | |
| # Look in ~/.oh-my-zsh/themes/ | |
| # Optionally, if you set this to "random", it'll load a random theme each | |
| # time that oh-my-zsh is loaded. | |
| # ZSH_THEME="robbyrussell" | |
| ZSH_THEME="agnoster" |
| #!/usr/bin/env bash | |
| # | |
| # Get the value of a tag for a running EC2 instance. | |
| # | |
| # This can be useful within bootstrapping scripts ("user-data"). | |
| # | |
| # Note the EC3 instance needs to have an IAM role that lets it read tags. The policy | |
| # JSON for this looks like: | |
| # | |
| # { |
| upstream backend { | |
| server localhost:8080; | |
| #server backup1.example.com:8080 backup; | |
| #server backup2.example.com:8080 backup; | |
| } | |
| # Set cache dir | |
| proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:10m; | |
| # Set cache key to include identifying components |