diff --git a/README.md b/README.md index 9870253..bd5965b 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,48 @@ Okteto is utilized for debugging. New build targets have been added to allow bui 5. (test changes, find they don't work, make more changes)... 6. `okteto down` 7. (commit code, and be happy) + + +## Running the Registry Locally (MacBook Example) + +1. **Prepare the data directory:** + + ```sh + cd registry/ + mkdir -p data + chmod 777 data + ``` + +2. **Build the Docker image:** + + ```sh + docker build -t my-ttlsh:latest . + ``` + +3. **Run the registry container:** + + ```sh + docker run -d \ + -p 5000:5000 \ + --name ttlsh \ + -e PORT=5000 \ + -e HOOK_TOKEN=localtoken \ + -e HOOK_URI=http://localhost:9999/hook \ + -e REPLREG_HOST=localhost:5000 \ + -e REPLREG_SECRET=localsecret \ + -v ttlsh-data:/var/lib/registry \ + my-ttlsh:latest + ``` + +4. **Verify the registry is running:** + + - Check logs: + ```sh + docker logs ttlsh + ``` + - Test the registry API: + ```sh + curl http://localhost:5000/v2/ + ``` + +This will start the Docker registry with your local configuration and environment variables. \ No newline at end of file diff --git a/registry/config.yml b/registry/config.yml index 5fbaa4e..80e425a 100644 --- a/registry/config.yml +++ b/registry/config.yml @@ -6,11 +6,8 @@ log: storage: delete: enabled: true - - gcs: - bucket: replreg - keyfile: /etc/gcs.json - rootdirectory: / + filesystem: + rootdirectory: /var/lib/registry http: addr: 0.0.0.0:__PORT__ @@ -22,8 +19,8 @@ notifications: - name: rgstry-hooks url: __HOOK_URI__ headers: - Authorization: ["Token __HOOK_TOKEN__"] + Authorization: + - "Token __HOOK_TOKEN__" timeout: 200ms threshold: 3 backoff: 5s - diff --git a/registry/entrypoint.sh b/registry/entrypoint.sh index fb74653..b5cbc19 100755 --- a/registry/entrypoint.sh +++ b/registry/entrypoint.sh @@ -1,22 +1,11 @@ #!/bin/sh - set -e -sed -i "s/__PORT__/$PORT/g" /etc/docker/registry/config.yml -sed -i "s/__HOOK_TOKEN__/$HOOK_TOKEN/g" /etc/docker/registry/config.yml -sed -i "s/__HOOK_URI__/$HOOK_URI/g" /etc/docker/registry/config.yml -sed -i "s/__REPLREG_HOST__/$REPLREG_HOST/g" /etc/docker/registry/config.yml -sed -i "s/__REPLREG_SECRET__/$REPLREG_SECRET/g" /etc/docker/registry/config.yml - -if [[ -z "${GCS_KEY_ENCODED}" ]]; then - echo "Set GCS_KEY_ENCODED variable" -else - echo ${GCS_KEY_ENCODED} | base64 -d > /etc/gcs.json - chmod 0400 /etc/gcs.json -fi - -# Run garbage collection job in background -# /garbage-collect.sh & +sed -i "s|__PORT__|$PORT|g" /etc/docker/registry/config.yml +sed -i "s|__HOOK_TOKEN__|$HOOK_TOKEN|g" /etc/docker/registry/config.yml +sed -i "s|__HOOK_URI__|$HOOK_URI|g" /etc/docker/registry/config.yml +sed -i "s|__REPLREG_HOST__|$REPLREG_HOST|g" /etc/docker/registry/config.yml +sed -i "s|__REPLREG_SECRET__|$REPLREG_SECRET|g" /etc/docker/registry/config.yml case "$1" in *.yaml|*.yml) set -- registry serve "$@" ;;