From de5c26ed4a996f3d0c3929314481ebd36427c453 Mon Sep 17 00:00:00 2001 From: Ramon Wijnands Date: Wed, 29 Jul 2020 11:05:05 +0200 Subject: [PATCH] Convert black back to a single stage based on review comments --- black/Dockerfile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/black/Dockerfile b/black/Dockerfile index e190d6b..705e4d0 100644 --- a/black/Dockerfile +++ b/black/Dockerfile @@ -1,18 +1,13 @@ -FROM python:3-alpine as black-build - -# we don't want gcc in the final image, so let's do a multi stage build -RUN apk update && apk add --no-cache build-base -RUN pip install --user --upgrade black - FROM python:3-alpine LABEL io.whalebrew.name 'black' LABEL io.whalebrew.config.working_dir '/workdir' WORKDIR /workdir -# copy only the installed files from black -COPY --from=black-build /root/.local /root/.local -ENV PATH=/root/.local/bin:$PATH +# we don't want gcc in the final image, so remove it in one docker layer +RUN apk add --no-cache build-base \ + && pip install --no-cache-dir --upgrade black \ + && apk del build-base ENTRYPOINT ["black"] CMD ["--help"] \ No newline at end of file