From da13d3b967e02be37ed38342bd4ccbaa1ccc3139 Mon Sep 17 00:00:00 2001 From: Jesse Quinn Date: Thu, 2 Jan 2020 19:08:48 -0300 Subject: [PATCH 1/5] modified Dockerfile --- .editorconfig | 15 +++++++++++++++ .gitignore | 3 ++- Dockerfile | 16 ++++++++++------ bin/compose_format | 1 - 4 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..168b26c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# https://editorconfig.org/ + +root = true + +[*] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf +charset = utf-8 + +# Docstrings and comments use max_line_length = 79 +[*.py] +max_line_length = 119 diff --git a/.gitignore b/.gitignore index 015e7ac..b4a6366 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /*.egg build tmp -README.rst \ No newline at end of file +README.rst +/venv/ diff --git a/Dockerfile b/Dockerfile index ca7478a..401daa7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,20 @@ -FROM alpine:3.3 +FROM alpine:3.10 MAINTAINER think@hotmail.de +ENV PYTHONUNBUFFERED=1 + RUN \ - apk add --no-cache python3 && \ - apk add --no-cache --virtual=build-dependencies wget ca-certificates && \ - wget "https://bootstrap.pypa.io/get-pip.py" -O /dev/stdout | python3 && \ - apk del build-dependencies + apk add --no-cache python3 && \ + if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \ + python3 -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip3 install --no-cache --upgrade pip setuptools wheel && \ + if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi RUN pip install --no-cache-dir ruamel.yaml COPY bin /bin -COPY compose_format /usr/lib/python3.5/site-packages/compose_format +COPY compose_format /usr/lib/python3.7/site-packages/compose_format RUN chmod +x /bin/compose_format diff --git a/bin/compose_format b/bin/compose_format index bea2c98..0a39f4a 100755 --- a/bin/compose_format +++ b/bin/compose_format @@ -1,7 +1,6 @@ #!/usr/bin/env python3 from compose_format import ComposeFormat - if __name__ == '__main__': import argparse From 857b53b4355fcbbf380368fc2acaaf909ead5477 Mon Sep 17 00:00:00 2001 From: Jesse Quinn Date: Thu, 2 Jan 2020 19:14:28 -0300 Subject: [PATCH 2/5] updated to alphine 3.11 for python 3.8.1 --- .gitignore | 1 + Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b4a6366..a8e5ae0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build tmp README.rst /venv/ +.idea diff --git a/Dockerfile b/Dockerfile index 401daa7..96d1a86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.10 +FROM alpine:3.11 MAINTAINER think@hotmail.de ENV PYTHONUNBUFFERED=1 @@ -14,7 +14,7 @@ RUN \ RUN pip install --no-cache-dir ruamel.yaml COPY bin /bin -COPY compose_format /usr/lib/python3.7/site-packages/compose_format +COPY compose_format /usr/lib/python3.8/site-packages/compose_format RUN chmod +x /bin/compose_format From 9fe34dfa709c7a416c00fff605fb8e9aff0bee96 Mon Sep 17 00:00:00 2001 From: Jesse Quinn Date: Thu, 2 Jan 2020 19:21:33 -0300 Subject: [PATCH 3/5] added new targets field --- compose_format/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose_format/__init__.py b/compose_format/__init__.py index d356c89..5593e06 100755 --- a/compose_format/__init__.py +++ b/compose_format/__init__.py @@ -42,7 +42,7 @@ class ComposeFormat: 'interval', 'timeout', 'retries', 'disable', ] - BUILD_ORDER = ['context', 'dockerfile', 'args'] + BUILD_ORDER = ['context', 'dockerfile', 'target', 'args'] ORDERS = { 'version': TOPLEVEL_ORDER, From 05aa86ffc9ff9efbd7e41ecdfbe0b549bd88de0b Mon Sep 17 00:00:00 2001 From: Jesse Quinn Date: Thu, 2 Jan 2020 19:25:16 -0300 Subject: [PATCH 4/5] cleaned code --- compose_format/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/compose_format/__init__.py b/compose_format/__init__.py index 5593e06..c138fc6 100755 --- a/compose_format/__init__.py +++ b/compose_format/__init__.py @@ -43,7 +43,6 @@ class ComposeFormat: 'disable', ] BUILD_ORDER = ['context', 'dockerfile', 'target', 'args'] - ORDERS = { 'version': TOPLEVEL_ORDER, 'services': TOPLEVEL_ORDER, From 32c4470a8c0f739f2c491f73243d0899648fbaa7 Mon Sep 17 00:00:00 2001 From: Jesse Quinn Date: Sun, 5 Jan 2020 07:35:35 -0300 Subject: [PATCH 5/5] updated BUILD_ORDER --- compose_format/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compose_format/__init__.py b/compose_format/__init__.py index c138fc6..0bac7af 100755 --- a/compose_format/__init__.py +++ b/compose_format/__init__.py @@ -42,7 +42,12 @@ class ComposeFormat: 'interval', 'timeout', 'retries', 'disable', ] - BUILD_ORDER = ['context', 'dockerfile', 'target', 'args'] + BUILD_ORDER = [ + 'context', + 'dockerfile', + 'target', + 'args' + ] ORDERS = { 'version': TOPLEVEL_ORDER, 'services': TOPLEVEL_ORDER,