Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions black/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
functions.sh
8 changes: 8 additions & 0 deletions black/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3-alpine

RUN pip install black

WORKDIR /apps

ENTRYPOINT ["black"]
CMD ["--help"]
41 changes: 41 additions & 0 deletions black/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# black
Auto-trigger docker build for [black](https://black.readthedocs.io/en/stable) when new release is announced

Multi-arch supported (linux/arm/v7,linux/arm64/v8,linux/arm/v6,linux/amd64,linux/ppc64le,linux/s390x)


### Repo:

https://github.com/alpine-docker/multi-arch-libs/blob/master/black/Dockerfile

### Daily build logs:

Docker images are built together:

https://app.circleci.com/pipelines/github/alpine-docker/multi-arch-libs

Image list:

https://github.com/alpine-docker/multi-arch-libs/tree/master#image-details

### Docker iamge tags:

https://hub.docker.com/r/alpine/black/tags/

# Usage:

# must mount the local folder to /apps in container.
docker run -ti --rm -v $(pwd):/apps alpine/black local_file.py

# run flake8 container as command
alias black="docker run -ti --rm -v $(pwd):/apps alpine/black"
black --help
black local_file.py

# The Processes to build this image

* Enable CI cronjob on this repo to run build regularly on master branch (Weekly)
* Build and push the images with latest version
* Run the latest image locally and get the application version
* Tag the image with the version, from previous step
* push the image with version via tool called [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane.md)
11 changes: 11 additions & 0 deletions black/version-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

curl -H "Cache-Control: no-cache" -sL "https://raw.githubusercontent.com/alpine-docker/multi-arch-libs/stable/functions.sh" -o functions.sh
source functions.sh

image="alpine/black"

version=$(docker run -ti --rm ${image} --version | head -n 1 | awk '/black,/{print $2}')

install_crane
./crane copy ${image} ${image}:${version}