Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
LeKovr committed Jul 1, 2022
1 parent 1f3c58e commit 40c8dfc
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env*
dockerhub
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 dopos
Copyright (c) 2022 Aleksey Kovrizhkin <lekovr+dopos@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# app custom Makefile

# Docker repo & image name without version
IMAGE ?= registry
# Hostname for external access
APP_SITE ?= dhub.dev.lan

# ------------------------------------------------------------------------------
# app custom config

IMAGE_VER ?= 2

LIB_PATH ?= dockerhub
DCAPE_ROOT ?= /opt/dcape/var

# ------------------------------------------------------------------------------
# .env template (custom part)
# inserted in .env.sample via 'make config'
define CONFIG_CUSTOM
# ------------------------------------------------------------------------------
# app custom config, generated by make config
# db:$(USE_DB) user:$(ADD_USER)

# Relative path to library sources from DCAPE/var
LIB_PATH=$(LIB_PATH)

# Path to /opt/dcape/var. Used only outside drone
DCAPE_ROOT=$(DCAPE_ROOT)

endef

# ------------------------------------------------------------------------------
# Find and include DCAPE/apps/drone/dcape-app/Makefile
DCAPE_COMPOSE ?= dcape-compose
DCAPE_MAKEFILE ?= $(shell docker inspect -f "{{.Config.Labels.dcape_app_makefile}}" $(DCAPE_COMPOSE))
ifeq ($(shell test -e $(DCAPE_MAKEFILE) && echo -n yes),yes)
include $(DCAPE_MAKEFILE)
else
include /opt/dcape-app/Makefile
endif
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,49 @@
# dcape-app-registry
Private docker registry for dcape users

[![GitHub Release][1]][2] [![GitHub code size in bytes][3]]() [![GitHub license][4]][5]

[1]: https://img.shields.io/github/release/dopos/dcape-app-registry.svg
[2]: https://github.com/dopos/dcape-app-registry/releases
[3]: https://img.shields.io/github/languages/code-size/dopos/dcape-app-registry.svg
[4]: https://img.shields.io/github/license/dopos/dcape-app-registry.svg
[5]: LICENSE

[Docker registry](https://github.com/distribution/distribution) application package for [dcape](https://github.com/dopos/dcape).
Access to registry is limited by [gitea](https://gitea.io) users the same way as other private [dcape](https://github.com/dopos/dcape) resources.

## Docker image used

* [registry](https://hub.docker.com/_/registry)

## Requirements

* linux 64bit (git, make, wget, gawk, openssl)
* [docker](http://docker.io)
* [dcape](https://github.com/dopos/dcape)
* [gitea](https://gitea.io)

## Usage

* Gitea: Fork or mirror this repo in your Git service
* Drone: Activate repo
* Gitea: "Test delivery", config sample will be saved to enfist
* Enfist: Edit config and remove .sample from name
* Gitea: "Test delivery" again (or Drone: "Restart") - app will be installed and started on webhook host

## TODO

* [ ] send image prefix to narra and check its presense in user's organizations list

## See also

* for docker registry: https://github.com/cesanta/docker_auth [out of time](https://github.com/cesanta/docker_auth/issues/288#issuecomment-702931777)
* https://github.com/goharbor/harbor
* http://port.us.org/ (wait for gitea support [here](http://port.us.org/features/oauth.html))
* [Deploy apps with dcape](https://dopos.github.io/dcape/usage/apps/)

## License

The MIT License (MIT), see [LICENSE](LICENSE).

Copyright (c) 2022 Aleksey Kovrizhkin <lekovr+dopos@gmail.com>
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '2.1'

services:

app:
image: ${IMAGE}:${IMAGE_VER}
restart: always
labels:
- "dcape.traefik.tag=${DCAPE_TAG}"
- "traefik.enable=true"
- "traefik.http.routers.${APP_TAG}.middlewares=narra"
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ${DCAPE_ROOT}/${LIB_PATH}:/var/lib/registry

0 comments on commit 40c8dfc

Please sign in to comment.