Prevent pending continuation line in generated Dockerfile

This commit is contained in:
Fabio Manganiello 2019-12-02 00:41:48 +01:00
parent de3bb48493
commit 47f7a36e6e
1 changed files with 6 additions and 2 deletions

View File

@ -88,11 +88,15 @@ def generate_dockerfile(deps, ports, cfgfile, devdir, python_version):
&& apk add --update --no-cache --virtual git \\ && apk add --update --no-cache --virtual git \\
''') ''')
for dep in deps: for i, dep in enumerate(deps):
content += '\t&& pip install {} \\\n'.format(dep) content += '\t&& pip install {}'.format(dep)
if i < len(deps)-1:
content += ' \\'.format(dep)
content += '\n'
content += textwrap.dedent( content += textwrap.dedent(
''' '''
RUN git clone https://github.com/BlackLight/platypush.git /app && cd /app RUN git clone https://github.com/BlackLight/platypush.git /app && cd /app
RUN pip install -r requirements.txt && python setup.py build install RUN pip install -r requirements.txt && python setup.py build install
RUN apk del git && apk del build-base RUN apk del git && apk del build-base