Dockyard
A image hub for rkt & docker and other container engine.
How to compile Dockyard application
Make sure Go has been installed and env has been set.
Clone code which Dockyard is depended into directory:
git clone https://github.com/containerops/dockyard.git $GOPATH/src/github.com/containerops/dockyard
git clone https://github.com/containerops/crew.git $GOPATH/src/github.com/containerops/crew
git clone https://github.com/containerops/wrench.git $GOPATH/src/github.com/containerops/wrench
Then exec commands in each project directory as below,it will download the third dependent packages automatically:
cd $GOPATH/src/github.com/containerops/dockyard
go get
cd $GOPATH/src/github.com/containerops/crew
go get
cd $GOPATH/src/github.com/containerops/wrench
go get
Finally,enter Dockyard directory and build:
cd $GOPATH/src/github.com/containerops/dockyard
go build
Dockyard runtime configuration
Please add a runtime config file named runtime.conf
under dockyard/conf
before starting dockyard
service.
runtime.conf
Example
runmode = dev
listenmode = https
httpscertfile = cert/containerops/containerops.crt
httpskeyfile = cert/containerops/containerops.key
[log]
filepath = log/containerops-log
[db]
uri = localhost:6379
passwd = containerops
db = 8
[dockyard]
path = data
domains = containerops.me
registry = 0.9
distribution = registry/2.0
standalone = true
driver = qiniu
[qiniu]
endpoint = xxx
bucket = xxx
accessKeyID = xxx
accessKeysecret = xxx
- runmode: application run mode must be
dev
orprod
. - listenmode: support
http
andhttps
protocol. - httpscertfile: specify user own https certificate file by this parameter.
- httpskeyfile: specify user own https key file by this parameter.
- [log] filepath: specify where Dockyard logs are stored.
- [db] uri: Dockyard database provider is
redis
,IP
andPort
would be specified beforeredis
boots. - [db] passwd: specify the password to login and access db.
- [db] db: specify db area number to use.
- [dockyard] path: specify where
Docker
andRocket
image files are stored. - [dockyard] domains: registry server name or IP.
- [dockyard] registry: specify the version of Docker V1 protocol.
- [dockyard] distribution: specify the version of Docker V2 protocol.
- [dockyard] standalone: must be
true
orfalse
,specify run mode whether do authorization checks or not.
Dockyard middleware configuration
Specify parameters to enable Dockyard notification function.
config.json
Example
{
"notifications":{
"name":"notifications",
"endpoints":[
{
"name":"notifyProxy",
"url":"http://notifyproxy:8088/events",
"headers":{"Authorization":["Bearer","token"]},
"timeout":5000,
"threshold":5,
"backoff":5000,
"eventdb":"/tmp",
"disabled":false
}
]
}
}
Nginx configuration
It's a Nginx config example. You can change client_max_body_size what limited upload file size.
You should copy containerops.me
keys from cert/containerops.me
to /etc/nginx
, then run Dockyard with http
mode and listen on 127.0.0.1:9911
.
upstream dockyard_upstream {
server 127.0.0.1:9911;
}
server {
listen 80;
server_name containerops.me;
rewrite ^/(.*)$ https://containerops.me/$1 permanent;
}
server {
listen 443;
server_name containerops.me;
access_log /var/log/nginx/containerops-me.log;
error_log /var/log/nginx/containerops-me-errror.log;
ssl on;
ssl_certificate /etc/nginx/containerops.me.crt;
ssl_certificate_key /etc/nginx/containerops.me.key;
client_max_body_size 1024m;
chunked_transfer_encoding on;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
location / {
proxy_pass http://dockyard_upstream;
}
}
How to run
Run directly:
./dockyard web --address 0.0.0.0 --port 80
Run behind Nginx:
./dockyard web --address 127.0.0.1 --port 9911
How to use
- Add containerops.me in your
hosts
file like192.168.1.66 containerops.me
with IP which rundockyard
. - Then
push
withdocker push containerops.me/somebody/ubuntu
. - You could
pull
withdocker pull -a containerops.me/somebody/ubuntu
. - Work fun!
Reporting issues
Please submit issue at https://github.com/containerops/dockyard/issues
Maintainers
- Meaglith Ma https://twitter.com/genedna
- Leo Meng https://github.com/fivestarsky
Licensing
Dockyard is licensed under the MIT License.
Todo in the feature
- Support Docker V1/V2 protocol conversion.
- Support Rocket CAS.
- More relative pages.