Skip to content

Instantly share code, notes, and snippets.

@ignlg
Created August 5, 2014 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ignlg/b4326859e659db4917e6 to your computer and use it in GitHub Desktop.
Save ignlg/b4326859e659db4917e6 to your computer and use it in GitHub Desktop.
Dokku apps' container name: Creates all NAME files to assign container names with the dokku-name plugin.
#!/bin/bash
###
# Dokku apps' container name
#
# Creates all NAME files to assign container names with the dokku-name plugin.
#
# Usage: ./dokku-container-name.sh [suffix]
#
# LICENSE:
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2014 Ignacio Lago <ignacio@ignaciolago.com>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
#
###
suffix="container"
if [[ "x$1" != "x" ]]; then
suffix="$1"
fi
for image in $(ls -l /home/dokku | grep "^d" | awk '{print $9}'); do
echo "${image}-${suffix}" > /home/dokku/${image}/NAME
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment