|
|
@ -3,6 +3,8 @@ import glob
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import argparse
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
all_subimages = {re.sub(r"^Dockerfile-", "", dockerfile) for dockerfile in glob.glob("Dockerfile-*")}
|
|
|
|
all_subimages = {re.sub(r"^Dockerfile-", "", dockerfile) for dockerfile in glob.glob("Dockerfile-*")}
|
|
|
|
core_subimages = {si for si in all_subimages if si.startswith("core")}
|
|
|
|
core_subimages = {si for si in all_subimages if si.startswith("core")}
|
|
|
@ -15,15 +17,15 @@ parser.add_argument('--core', action='store_true',
|
|
|
|
default=False, help='List core subimages')
|
|
|
|
default=False, help='List core subimages')
|
|
|
|
parser.add_argument('--rest', action='store_true',
|
|
|
|
parser.add_argument('--rest', action='store_true',
|
|
|
|
default=False, help='List rest subimages')
|
|
|
|
default=False, help='List rest subimages')
|
|
|
|
parser.add_argument('--csv', action='store_true',
|
|
|
|
parser.add_argument('--json', action='store_true',
|
|
|
|
default=False, help='Return list as CSV')
|
|
|
|
default=False, help='Return list as JSON')
|
|
|
|
args = parser.parse_args()
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def list_(subimages):
|
|
|
|
def list_(subimages):
|
|
|
|
subimages = sorted(subimages)
|
|
|
|
subimages = sorted(subimages)
|
|
|
|
if args.csv:
|
|
|
|
if args.json:
|
|
|
|
print(",".join(subimages))
|
|
|
|
print(json.dumps(subimages))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print("\n".join(subimages))
|
|
|
|
print("\n".join(subimages))
|
|
|
|
|
|
|
|
|
|
|
|