Skip to content

Commit

Permalink
Convert black back to a single stage based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayman committed Jul 29, 2020
1 parent ab13486 commit de5c26e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions black/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit de5c26e

Please sign in to comment.