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..a8e5ae0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ /*.egg build tmp -README.rst \ No newline at end of file +README.rst +/venv/ +.idea diff --git a/Dockerfile b/Dockerfile index ca7478a..96d1a86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,20 @@ -FROM alpine:3.3 +FROM alpine:3.11 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.8/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 diff --git a/compose_format/__init__.py b/compose_format/__init__.py index d356c89..0bac7af 100755 --- a/compose_format/__init__.py +++ b/compose_format/__init__.py @@ -42,8 +42,12 @@ class ComposeFormat: 'interval', 'timeout', 'retries', 'disable', ] - BUILD_ORDER = ['context', 'dockerfile', 'args'] - + BUILD_ORDER = [ + 'context', + 'dockerfile', + 'target', + 'args' + ] ORDERS = { 'version': TOPLEVEL_ORDER, 'services': TOPLEVEL_ORDER,