diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..965c2aa --- /dev/null +++ b/.drone.yml @@ -0,0 +1,26 @@ +--- +kind: pipeline +type: docker +name: docker-build + +steps: + - name: docker build + image: shnee:dind + volumes: + - name: dockersock + path: /var/run + commands: + - sleep 5 # give docker enough time to start + - make + +services: + - name: docker + image: docker:dind + privileged: true + volumes: + - name: dockersock + path: /var/run + +volumes: + - name: dockersock + temp: {} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e887af --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM docker:dind + +RUN apk add --no-cache \ + make diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..88aa8a9 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +default: build + +DATE = $(shell date +%F) +SHORT_COMMIT_HASH = $(shell git log -1 --format=%h) + +build: + docker build . -t shnee/dind:latest + +tag: + docker tag shnee/dind:latest shnee/dind:$(DATE)-$(SHORT_COMMIT_HASH) + +clean: rm-unique + -docker rmi shnee/dind:latest + +rm-unique: + -docker rmi shnee/dind:$(DATE)-$(SHORT_COMMIT_HASH) + +help: + @echo TODO REM do me. + +.PHONY: default build tag clean rm-unique help