forked from quay/mirror-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (41 loc) · 2.02 KB
/
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
42
43
44
45
46
47
include .env
CLIENT ?= podman
# RELEASE_VERSION is overridden in CI as the git tag matching format v[0-9]+.[0-9]+.[0-9]+
RELEASE_VERSION ?= dev
all:
build-golang-executable:
$(CLIENT) run --rm -v ${PWD}:/usr/src:Z -w /usr/src docker.io/golang:1.16 go build -v \
-ldflags "-X github.com/quay/mirror-registry/cmd.eeImage=${EE_IMAGE} -X 'github.com/quay/mirror-registry/cmd.quayImage=${QUAY_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.redisImage=${REDIS_IMAGE}' -X 'github.com/quay/mirror-registry/cmd.postgresImage=${POSTGRES_IMAGE}'" \
-o mirror-registry;
build-online-zip:
$(CLIENT) build \
-t mirror-registry-online:${RELEASE_VERSION} \
--build-arg RELEASE_VERSION=${RELEASE_VERSION} \
--build-arg QUAY_IMAGE=${QUAY_IMAGE} \
--build-arg EE_IMAGE=${EE_IMAGE} \
--build-arg EE_BASE_IMAGE=${EE_BASE_IMAGE} \
--build-arg EE_BUILDER_IMAGE=${EE_BUILDER_IMAGE} \
--build-arg POSTGRES_IMAGE=${POSTGRES_IMAGE} \
--build-arg REDIS_IMAGE=${REDIS_IMAGE} \
--build-arg PAUSE_IMAGE=${PAUSE_IMAGE} \
--file Dockerfile.online .
$(CLIENT) run --name mirror-registry-online-${RELEASE_VERSION} mirror-registry-online:${RELEASE_VERSION}
$(CLIENT) cp mirror-registry-online-${RELEASE_VERSION}:/mirror-registry.tar.gz .
$(CLIENT) rm mirror-registry-online-${RELEASE_VERSION}
build-offline-zip:
$(CLIENT) build \
-t mirror-registry-offline:${RELEASE_VERSION} \
--build-arg RELEASE_VERSION=${RELEASE_VERSION} \
--build-arg QUAY_IMAGE=${QUAY_IMAGE} \
--build-arg EE_IMAGE=${EE_IMAGE} \
--build-arg EE_BASE_IMAGE=${EE_BASE_IMAGE} \
--build-arg EE_BUILDER_IMAGE=${EE_BUILDER_IMAGE} \
--build-arg POSTGRES_IMAGE=${POSTGRES_IMAGE} \
--build-arg REDIS_IMAGE=${REDIS_IMAGE} \
--build-arg PAUSE_IMAGE=${PAUSE_IMAGE} \
--file Dockerfile .
$(CLIENT) run --name mirror-registry-offline-${RELEASE_VERSION} mirror-registry-offline:${RELEASE_VERSION}
$(CLIENT) cp mirror-registry-offline-${RELEASE_VERSION}:/mirror-registry.tar.gz .
$(CLIENT) rm mirror-registry-offline-${RELEASE_VERSION}
clean:
rm -rf mirror-registry* image-archive.tar