Add personal image with hadolint
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9898c0a9cc
commit
becc9bf0b1
12
.drone.yml
12
.drone.yml
@ -16,6 +16,18 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: push personal image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: iamthefij/drone-pre-commit
|
||||||
|
dockerfile: ./Dockerfile.personal
|
||||||
|
tags:
|
||||||
|
- personal
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: notify
|
name: notify
|
||||||
|
8
Dockerfile.personal
Normal file
8
Dockerfile.personal
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
ARG BASE_IMAGE=iamthefij/drone-pre-commit
|
||||||
|
FROM ${BASE_IMAGE}:base
|
||||||
|
|
||||||
|
# Add helper scripts
|
||||||
|
COPY ./scripts /scripts
|
||||||
|
|
||||||
|
# Bundle hadolint
|
||||||
|
RUN /scripts/add_hadolint.sh
|
5
Makefile
5
Makefile
@ -12,6 +12,11 @@ test: build
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: ./Dockerfile
|
build: ./Dockerfile
|
||||||
docker build -t $(DOCKER_TAG) .
|
docker build -t $(DOCKER_TAG) .
|
||||||
|
docker tag "$(DOCKER_TAG):latest" "$(DOCKER_TAG):base"
|
||||||
|
|
||||||
|
.PHONY: build-personal
|
||||||
|
build-personal: build ./Dockerfile.personal
|
||||||
|
docker build --build-arg "BASE_IMAGE=$(DOCKER_TAG)" -f ./Dockerfile.personal .
|
||||||
|
|
||||||
.PHONY: install-hooks
|
.PHONY: install-hooks
|
||||||
install-hooks:
|
install-hooks:
|
||||||
|
@ -24,6 +24,12 @@ steps:
|
|||||||
- pre-commit run --all-files
|
- pre-commit run --all-files
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Personal image
|
||||||
|
|
||||||
|
A second image is also built for my personal use, but it may be useful to you as well. This image includes the following dependencies:
|
||||||
|
|
||||||
|
* hadolint
|
||||||
|
|
||||||
## To Do
|
## To Do
|
||||||
|
|
||||||
So far this is basic and unopinionated. Either this will become very personal as I tack on dependencies for the hooks I often use, or it'll become complicated as I add args for everything and build out many tags. I think I'll probbably try to provide some reasonable base image that can then be extended in a new image or as part of one's build pipeline.
|
So far this is basic and unopinionated. Either this will become very personal as I tack on dependencies for the hooks I often use, or it'll become complicated as I add args for everything and build out many tags. I think I'll probbably try to provide some reasonable base image that can then be extended in a new image or as part of one's build pipeline.
|
||||||
|
6
scripts/add_hadolint.sh
Executable file
6
scripts/add_hadolint.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
VERSION=v1.18.0
|
||||||
|
wget -L -O /usr/bin/hadolint "https://github.com/hadolint/hadolint/releases/download/${VERSION}/hadolint-Linux-x86_64"
|
||||||
|
chmod +x /usr/bin/hadolint
|
Loading…
Reference in New Issue
Block a user