Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.

Commit 9ca29c4

Browse files
committed
fix #18: separate docker backup and main publishing; optimize docker context
1 parent 4c3a732 commit 9ca29c4

File tree

3 files changed

+37
-19
lines changed

3 files changed

+37
-19
lines changed

.dockerignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# folders
2+
.github
3+
api
4+
bin
5+
docs
6+
env
7+
test
8+
third_party
9+
tools
10+
11+
# files
12+
.gitattributes
13+
.gitignore
14+
.gitmodule
15+
Makefile
16+
README.md

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ MODULE = $(shell go list -m)
99
PATHS = $(shell go list ./... | sed -e "s|$(shell go list -m)/\{0,1\}||g")
1010
SHELL = /bin/bash -euo pipefail
1111
TIMEOUT = 1s
12-
VERSION = 1.x
1312

1413
export PATH := $(BINPATH):$(PATH)
1514

env/make/docker.mk

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
ifndef VERSION
2-
$(error Please define VERSION variable)
3-
endif
1+
IMAGE = octopot/tablo
2+
BACKUP = quay.io/octopot/tablo
3+
VERSION = 1.x
4+
5+
.PHONY: docker-backup
6+
docker-backup:
7+
@docker tag $(IMAGE):$(VERSION) $(BACKUP):$(VERSION)
8+
@docker tag $(IMAGE):latest $(BACKUP):latest
9+
@docker push $(BACKUP):$(VERSION)
10+
@docker push $(BACKUP):latest
411

512
.PHONY: docker-build
613
docker-build:
714
docker build -f env/docker/service/Dockerfile \
8-
-t octopot/tablo:$(VERSION) \
9-
-t octopot/tablo:latest \
10-
-t quay.io/octopot/tablo:$(VERSION) \
11-
-t quay.io/octopot/tablo:latest \
15+
-t $(IMAGE):$(VERSION) \
16+
-t $(IMAGE):latest \
1217
--force-rm --no-cache --pull --rm \
1318
.
1419

@@ -17,17 +22,15 @@ docker-publish: docker-build docker-push
1722

1823
.PHONY: docker-push
1924
docker-push:
20-
docker push octopot/tablo:$(VERSION)
21-
docker push octopot/tablo:latest
22-
docker push quay.io/octopot/tablo:$(VERSION)
23-
docker push quay.io/octopot/tablo:latest
25+
@docker push $(IMAGE):$(VERSION)
26+
@docker push $(IMAGE):latest
2427

2528
.PHONY: docker-run
2629
docker-run:
27-
docker run --rm -it \
28-
--name tablo-dev \
29-
-p 8080:8080 \
30-
-p 8090:8090 \
31-
-p 8091:8091 \
32-
-p 8092:8092 \
33-
octopot/tablo:$(VERSION) run --with-monitoring --with-profiling
30+
@docker run --rm -it \
31+
--name $(subst /,-,$(IMAGE))-dev \
32+
-p 8080:8080 \
33+
-p 8090:8090 \
34+
-p 8091:8091 \
35+
-p 8092:8092 \
36+
$(IMAGE):$(VERSION) run --with-monitoring --with-profiling

0 commit comments

Comments
 (0)