mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-21 23:21:26 +01:00
update compose template, introduce support for photon
This commit is contained in:
parent
14640c59dc
commit
73b5ea0916
2
.gitignore
vendored
2
.gitignore
vendored
@ -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
|
||||
|
@ -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
|
||||
|
90
Deploy/docker-compose.yml.photon
Normal file
90
Deploy/docker-compose.yml.photon
Normal 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"
|
@ -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
|
8
Deploy/jobservice/Dockerfile.jobservice.photon
Normal file
8
Deploy/jobservice/Dockerfile.jobservice.photon
Normal 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"]
|
26
Deploy/log/Dockerfile.log.photon
Normal file
26
Deploy/log/Dockerfile.log.photon
Normal 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
|
35
Deploy/log/logrotate.conf.photon
Normal file
35
Deploy/log/logrotate.conf.photon
Normal 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.
|
17
Deploy/ui/Dockerfile.ui.photon
Normal file
17
Deploy/ui/Dockerfile.ui.photon
Normal 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"]
|
Loading…
Reference in New Issue
Block a user