Merge pull request #711 from reasonerjt/master

update compose template, introduce support for photon
This commit is contained in:
Daniel Jiang 2016-08-24 11:46:19 +08:00 committed by GitHub
commit bd2aa49fe0
9 changed files with 182 additions and 3 deletions

2
.gitignore vendored
View File

@ -4,6 +4,8 @@ Deploy/config/ui/env
Deploy/config/ui/app.conf
Deploy/config/db/env
Deploy/config/jobservice/env
Deploy/ui/harbor_ui
Deploy/jobservice/harbor_jobservice
ui/ui
*.pyc
jobservice/test

View File

@ -8,7 +8,7 @@ services:
ports:
- 1514:514
registry:
image: library/registry:2.4.0
image: library/registry:2.5.0
restart: always
volumes:
- /data/registry:/storage
@ -43,7 +43,7 @@ services:
ui:
build:
context: ../
dockerfile: Dockerfile.ui
dockerfile: Deploy/ui/Dockerfile
env_file:
- ./config/ui/env
restart: always
@ -60,7 +60,7 @@ services:
jobservice:
build:
context: ../
dockerfile: Dockerfile.job
dockerfile: Deploy/jobservice/Dockerfile
env_file:
- ./config/jobservice/env
restart: always

View File

@ -0,0 +1,90 @@
version: '2'
services:
log:
image: harbor_log_photon
restart: always
volumes:
- /var/log/harbor/:/var/log/docker/
ports:
- 1514:514
registry:
image: library/registry:2.5.0
restart: always
volumes:
- /data/registry:/storage
- ./config/registry/:/etc/registry/
environment:
- GODEBUG=netdns=cgo
ports:
- 5001:5001
command:
["serve", "/etc/registry/config.yml"]
depends_on:
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "registry"
mysql:
build: ./db/
restart: always
volumes:
- /data/database:/var/lib/mysql
env_file:
- ./config/db/env
depends_on:
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "mysql"
ui:
image: harbor_ui_photon
env_file:
- ./config/ui/env
restart: always
volumes:
- ./config/ui/app.conf:/etc/ui/app.conf
- ./config/ui/private_key.pem:/etc/ui/private_key.pem
depends_on:
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "ui"
jobservice:
image: harbor_jobservice_photon
env_file:
- ./config/jobservice/env
restart: always
volumes:
- /data/job_logs:/var/log/jobs
- ./config/jobservice/app.conf:/etc/jobservice/app.conf
depends_on:
- ui
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "jobservice"
proxy:
image: library/nginx:1.9.0
restart: always
volumes:
- ./config/nginx:/etc/nginx
ports:
- 80:80
- 443:443
depends_on:
- mysql
- registry
- ui
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "proxy"

View File

@ -5,6 +5,7 @@ MAINTAINER jiangd@vmware.com
RUN apt-get update \
&& apt-get install -y libldap2-dev \
&& rm -r /var/lib/apt/lists/*
COPY . /go/src/github.com/vmware/harbor
WORKDIR /go/src/github.com/vmware/harbor/jobservice

View File

@ -0,0 +1,8 @@
FROM library/photon:latest
RUN mkdir /harbor/
COPY ./Deploy/jobservice/harbor_jobservice /harbor/
RUN chmod u+x /harbor/harbor_jobservice
WORKDIR /harbor/
ENTRYPOINT ["/harbor/harbor_jobservice"]

View File

@ -0,0 +1,26 @@
FROM library/photon:latest
# run logrotate hourly, disable imklog model, provides TCP/UDP syslog reception
RUN tdnf install -y cronie rsyslog logrotate shadow\
&& mv /etc/cron.daily/logrotate /etc/cron.hourly/ \
&& mkdir /etc/rsyslog.d/ \
&& mkdir /var/spool/rsyslog \
&& groupadd syslog \
&& useradd -g syslog syslog
ADD rsyslog.conf /etc/rsyslog.conf
COPY logrotate.conf.photon /etc/logrotate.conf
# logrotate configuration file for docker
ADD logrotate_docker.conf /etc/logrotate.d/
# rsyslog configuration file for docker
ADD rsyslog_docker.conf /etc/rsyslog.d/
VOLUME /var/log/docker/
EXPOSE 514
CMD crond && rsyslogd -n

View File

@ -0,0 +1,35 @@
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp and btmp -- we'll rotate them here
#/var/log/wtmp {
# monthly
# create 0664 root utmp
# minsize 1M
# rotate 1
#}
/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 1
}
# system-specific logs may be also be configured here.

View File

@ -0,0 +1,17 @@
FROM library/photon:latest
RUN mkdir /harbor/
RUN tdnf install -y sed apr-util-ldap
COPY ./Deploy/ui/harbor_ui /harbor/
COPY ./views /harbor/views
COPY ./static /harbor/static
COPY ./favicon.ico /harbor/favicon.ico
COPY ./Deploy/jsminify.sh /tmp/jsminify.sh
RUN chmod u+x /harbor/harbor_ui \
&& tmp/jsminify.sh /harbor/views/sections/script-include.htm /harbor/static/resources/js/harbor.app.min.js /harbor/ \
&& echo "TLS_REQCERT allow" >> /etc/openldap/ldap.conf
WORKDIR /harbor/
ENTRYPOINT ["/harbor/harbor_ui"]