-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert black back to a single stage based on review comments
- Loading branch information
Showing
1 changed file
with
4 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |