Skip to content

Commit

Permalink
Add alpine-based image
Browse files Browse the repository at this point in the history
  • Loading branch information
devste committed May 4, 2019
1 parent 1b24767 commit fa042db
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile.alpine
8 changes: 8 additions & 0 deletions Dockerfile.alpine.3.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine:3.9
RUN apk add --no-cache \
git \
python3
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pre-commit sample-config > /.pre-commit-config.yaml
ENTRYPOINT ["pre-commit", "run", "--config", "/.pre-commit-config.yaml"]
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
.DEFAULT_GOAL := help
DOCKER=docker
DOCKER_TAG=petzi/pre-commit
DOCKER_TAG_ALPINE=$(DOCKER_TAG):alpine
DOCKER_TAG_UBUNTU=$(DOCKER_TAG):ubuntu

# The help command is inspired by this post:
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
Expand All @@ -12,5 +14,7 @@ help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: build
build: ## Build the image on development
build: ## Build the images on development
$(DOCKER) build -t $(DOCKER_TAG) .
$(DOCKER) build -f Dockerfile.alpine -t $(DOCKER_TAG_ALPINE) .
$(DOCKER) build -f Dockerfile.ubuntu -t $(DOCKER_TAG_UBUNTU) .

0 comments on commit fa042db

Please sign in to comment.