Skip to content

Commit

Permalink
created dockerfile and compose for registry browser
Browse files Browse the repository at this point in the history
  • Loading branch information
btr1975 committed Jun 4, 2021
1 parent 85ffea9 commit 84893a7
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@ http://<ip or domain name>:5000/v2/<repo-name>/tags/list
| Influxdb | Series dB |
| Grafana | Pretty Graphs |
| Docker Registry | To hold docker images |
| Docker Registry Browser | To Browse the Registry |

![Automation Framework Compose](diagrams/automation_framework_compose.png)
Binary file modified diagrams/automation_framework_compose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion diagrams/automation_framework_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def main():
python_container = Python('APIs\nOther Microservices')

with Cluster('Docker Registry'):
docker_registry_container = Docker('Docker Registry:5000')
docker_registry_container = Docker('Docker Registry\ntcp:5000')

with Cluster('Docker Registry Browser'):
docker_registry_browser_container = Python('Docker Registry Browser\ntcp:8088')

with Cluster('BatFish'):
batfish_container = Custom('BatFish\ntcp:8888\ntcp:9997\ntcp:9996', 'custom_icons/BatFish.png')
Expand Down
15 changes: 15 additions & 0 deletions docker/compose/docker-compose-rh-registry-browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
version: '3.7'
services:
rh-registry-browser:
build:
context: ../dockerfile
dockerfile: Dockerfile-rh-registry-browser
image: rh-registry-browser:latest
hostname: rh-registry-browser
container_name: rh-registry-browser
ports:
- "8088:80"
environment:
REGISTRY_SERVER: http://10.0.0.101
restart: on-failure
17 changes: 17 additions & 0 deletions docker/dockerfile/Dockerfile-rh-registry-browser
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM registry.access.redhat.com/ubi8/python-38

LABEL version="2021.6.3.001"
LABEL description="Docker Registry Browser RHEL8"
LABEL maintainer="Ben Trachtenberg"

COPY ./registry-browser /registry-browser

WORKDIR /registry-browser

RUN pip install --upgrade pip \
&& pip install --upgrade setuptools wheel \
&& pip install -r requirements.txt

EXPOSE 80/tcp

ENTRYPOINT ["python", "run_web_app.py"]
3 changes: 3 additions & 0 deletions docker/dockerfile/registry-browser/run_web_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from web_app import run_local_server

run_local_server('0.0.0.0', 80)
9 changes: 6 additions & 3 deletions docker/dockerfile/registry-browser/web_app.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
"""
Repository Browser Web Server
"""
import os
import flask
from flask import Flask
from flask import render_template
from registry_browser import DockerRegistryApi


app = Flask(__name__, template_folder='./templates')
REGISTRY_SERVER = os.environ.get('REGISTRY_SERVER') or 'http://127.0.0.1'

print(f'USING REGISTRY_SERVER {REGISTRY_SERVER}')

@app.route('/', methods=['GET'])
def home():
if flask.request.method == 'GET':
registry = DockerRegistryApi('http://10.0.0.101')
registry = DockerRegistryApi(REGISTRY_SERVER)
return render_template(
'home.html',
title='Docker Registry Browser Home',
Expand All @@ -28,7 +31,7 @@ def home():
@app.route('/repository/<repository_name>', methods=['GET'])
def repository(repository_name):
if flask.request.method == 'GET':
registry = DockerRegistryApi('http://10.0.0.101')
registry = DockerRegistryApi(REGISTRY_SERVER)
return render_template(
'repository-info.html',
title=f'Docker Registry Repository Tags {repository_name}',
Expand All @@ -44,7 +47,7 @@ def repository(repository_name):
@app.route('/manifest/<repository_name>/<tag>', methods=['GET'])
def repository_tag_manifest(repository_name, tag):
if flask.request.method == 'GET':
registry = DockerRegistryApi('http://10.0.0.101')
registry = DockerRegistryApi(REGISTRY_SERVER)
manifest = registry.get_pretty_json(registry.get_repository_manifest(repository_name, tag))
return render_template(
'repository-tag-manifest-info.html',
Expand Down

0 comments on commit 84893a7

Please sign in to comment.