Modify docker compose file template and make file to enable new job service

Fix typo in Makefile under photon

Fix version tag issue of redis container

Assign container name for redis container

Update docker compose template to enable network for redis

Remove exposed ports of redis from compose yaml tpl
This commit is contained in:
Steven Zou 2018-03-30 13:22:10 +08:00
parent 4e3a0b599f
commit 250360307b
5 changed files with 24 additions and 4 deletions

View File

@ -103,6 +103,7 @@ MARIADBVERSION=$(VERSIONTAG)
CLAIRVERSION=v2.0.1
CLAIRDBVERSION=$(VERSIONTAG)
MIGRATORVERSION=1.4
REDISVERSION=$(VERSIONTAG)
#clarity parameters
CLARITYIMAGE=vmware/harbor-clarity-ui-builder[:tag]
@ -282,7 +283,7 @@ build:
make -f $(MAKEFILEPATH_PHOTON)/Makefile build -e DEVFLAG=$(DEVFLAG) -e MARIADBVERSION=$(MARIADBVERSION) \
-e REGISTRYVERSION=$(REGISTRYVERSION) -e NGINXVERSION=$(NGINXVERSION) -e NOTARYVERSION=$(NOTARYVERSION) \
-e CLAIRVERSION=$(CLAIRVERSION) -e CLAIRDBVERSION=$(CLAIRDBVERSION) -e VERSIONTAG=$(VERSIONTAG) \
-e BUILDBIN=$(BUILDBIN)
-e BUILDBIN=$(BUILDBIN) -e REDISVERSION=$(REDISVERSION)
modify_composefile: modify_composefile_notary modify_composefile_clair
@echo "preparing docker-compose file..."
@ -294,6 +295,7 @@ modify_composefile: modify_composefile_notary modify_composefile_clair
@$(SEDCMD) -i 's/__reg_version__/$(REGISTRYVERSION)-$(VERSIONTAG)/g' $(DOCKERCOMPOSEFILEPATH)/ha/$(DOCKERCOMPOSEFILENAME)
@$(SEDCMD) -i 's/__nginx_version__/$(NGINXVERSION)/g' $(DOCKERCOMPOSEFILEPATH)/$(DOCKERCOMPOSEFILENAME)
@$(SEDCMD) -i 's/__nginx_version__/$(NGINXVERSION)/g' $(DOCKERCOMPOSEFILEPATH)/ha/$(DOCKERCOMPOSEFILENAME)
@$(SEDCMD) -i 's/__redis_version__/$(REDISVERSION)/g' $(DOCKERCOMPOSEFILEPATH)/$(DOCKERCOMPOSEFILENAME)
modify_composefile_notary:
@echo "preparing docker-compose notary file..."

View File

@ -18,9 +18,9 @@ worker_pool:
#Additional config if use 'redis' backend
#TODO: switch to internal redis endpoint and namespace.
redis_pool:
host: "redis_host"
host: "redis"
port: 6379
namespace: "namespace"
namespace: "harbor_job_service_namespace"
#Logger for job
logger:
path: "/var/log/jobs"

View File

@ -103,6 +103,7 @@ services:
networks:
- harbor
depends_on:
- redis
- ui
- adminserver
logging:
@ -110,6 +111,14 @@ services:
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "jobservice"
redis:
image: vmware/redis-photon:__redis_version__
container_name: redis
restart: always
volumes:
- /data/redis:/data
networks:
- harbor
proxy:
image: vmware/nginx-photon:__nginx_version__
container_name: nginx

View File

@ -80,6 +80,10 @@ DOCKERIMAGENAME_NOTARYSIGNER=vmware/notary-signer-photon
DOCKERFILENAME_NOTARYSERVER=server.Dockerfile
DOCKERIMAGENAME_NOTARYSERVER=vmware/notary-server-photon
DOCKERFILEPATH_REDIS=$(DOCKERFILEPATH)/redis
DOCKERFILENAME_REDIS=Dockerfile
DOCKERIMAGENAME_REDIS=vmware/redis-photon
_build_db: _build_mariadb
@echo "modify the db dockerfile..."
@$(SEDCMD) -i 's/__version__/$(MARIADBVERSION)/g' $(DOCKERFILEPATH_DB)/$(DOCKERFILENAME_DB)
@ -167,11 +171,16 @@ _build_mariadb:
@cd $(DOCKERFILEPATH_MARIADB) && $(DOCKERBUILD) -f $(DOCKERFILEPATH_MARIADB)/$(DOCKERFILENAME_MARIADB) -t $(DOCKERIMAGENAME_MARIADB):$(MARIADBVERSION) .
@echo "Done."
_build_redis:
@echo "building redis container for photon..."
@cd $(DOCKERFILEPATH_REDIS) && $(DOCKERBUILD) -f $(DOCKERFILEPATH_REDIS)/$(DOCKERFILENAME_REDIS) -t $(DOCKERIMAGENAME_REDIS):$(REDISVERSION) .
@echo "Done."
define _get_binary
$(WGET) --timeout 30 --no-check-certificate $1 -O $2
endef
build: _build_postgresql _build_db _build_adminiserver _build_ui _build_jobservice _build_log _build_nginx _build_registry _build_notary _build_clair
build: _build_postgresql _build_db _build_adminiserver _build_ui _build_jobservice _build_log _build_nginx _build_registry _build_notary _build_clair _build_redis
cleanimage:
@echo "cleaning image for photon..."

Binary file not shown.