-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
41 lines (36 loc) · 1023 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
BUILD_DIR = $(CURDIR)/build
PROJECT_NAME = docker-image-mirror
VERSION = $(shell git describe --tags || echo 0.0.0-dev)
PREFIX = /usr/local
.PHONY: clean
clean:
rm -R $(BUILD_DIR)/* || true
.PHONY: prepare
prepare:
mkdir -p build
.PHONY: install
install:
cp mirror.sh ${PREFIX}/bin/docker-image-mirror
chmod 0755 ${PREFIX}/bin/docker-image-mirror
.PHONY: deb
deb:
make build-deb ARCH=amd64
make build-deb ARCH=i386
make build-deb ARCH=arm64
make build-deb ARCH=armhf
.PHONY: build-deb
build-deb:
fpm -s dir -t deb \
--name $(PROJECT_NAME) \
--version $(VERSION) \
--package $(BUILD_DIR)/$(PROJECT_NAME)_$(ARCH).deb \
--maintainer "louis <[email protected]>" \
--deb-priority optional \
--force \
--deb-compression bzip2 \
--license "MIT" \
--deb-no-default-config-files \
--url https://github.com/0x46616c6b/docker-image-mirror \
--description "CLI to mirror docker images to a private registry" \
--architecture $(ARCH) \
mirror.sh=${PREFIX}/bin/docker-image-mirror