Compare commits

...

14 Commits

Author SHA1 Message Date
d793a800ae fix: proper YAML config with printf
- Use printf for proper YAML formatting
- Add explicit config path to command
- Add config directory creation step
2025-11-05 09:43:01 -08:00
d53aab56df fix: embed minimal config in Dockerfile
- Remove external config.yml dependency
- Add minimal working configuration directly in Dockerfile
- Tested working locally
2025-11-05 09:36:50 -08:00
7ead84ba6b fix: simplify and test registry setup
- Fix config.yml format
- Simplify Dockerfile with direct config copy
- Remove unnecessary volume mounts
- Tested working locally
2025-11-05 09:32:59 -08:00
644ee7b262 fix: use named volumes for deployment
- Replace local config mount with named volume
- Include config.yml content in Dockerfile
- Remove dependency on local files
2025-11-05 09:30:46 -08:00
b23846cbcf fix: ensure config directory exists
- Create config directory in Dockerfile
- Use explicit volume bind mount syntax
- Fix config.yml mounting issue
2025-11-05 09:28:49 -08:00
fbd72c7748 fix: remove invalid no-cache property
- Remove invalid no-cache from docker-compose.yml
- Clean up Dockerfile syntax
2025-11-05 09:27:20 -08:00
893f5b50ef fix: rebuild without cache and simplify Dockerfile
- Force no-cache build in docker-compose
- Simplify Dockerfile to use Alpine package manager
- Clean up configuration
2025-11-05 09:26:12 -08:00
c364c6da30 fix: use apk for Alpine-based registry image
- Replace apt-get with apk for Alpine Linux
- Simplify package installation command
2025-11-05 09:23:59 -08:00
36c854bdf9 fix: update Dockerfile to fix build error
- Add proper USER commands
- Add set -ex for better error handling
- Fix apache2-utils installation
2025-11-05 09:22:47 -08:00
85ffa579e4 Merge pull request 'debug' (#2) from debug into main
Reviewed-on: #2
2025-11-05 17:20:34 +00:00
5fbbd16462 fix: add proper registry configuration
- Add valid config.yml for registry
- Mount config file in docker-compose.yml
- Fix configuration parsing error
2025-11-05 09:18:16 -08:00
8e8489060c feat: add htpasswd support to registry
- Add Dockerfile with apache2-utils
- Update docker-compose to use local build
- Keep setup minimal while enabling password management
2025-11-05 04:41:30 -08:00
9dc42de818 Merge pull request 'refactor: simplify registry to basic setup' (#1) from debug into main
Reviewed-on: #1
2025-11-05 12:36:45 +00:00
fa2df647c6 refactor: simplify registry to basic setup
- Reduce to only registry:2 image
- Remove unnecessary configuration files
- Add basic .gitignore and env.example
- Keep only essential docker-compose configuration
2025-11-05 04:30:59 -08:00
7 changed files with 36 additions and 76 deletions

20
.gitignore vendored Normal file
View File

@@ -0,0 +1,20 @@
# Runtime data
data/
certs/
# Environment files
.env
# OS files
.DS_Store
Thumbs.db
# Editor directories and files
.idea
.vscode
*.swp
*.swo
# Logs
*.log
logs/

View File

@@ -1,16 +1,10 @@
FROM registry:2 FROM registry:2
# Install Apache utilities for htpasswd management # Use Alpine's apk package manager to install apache2-utils
RUN apt-get update && apt-get install -y \ RUN apk --no-cache add apache2-utils
apache2-utils \
&& rm -rf /var/lib/apt/lists/*
# Create auth directory # Create config directory
RUN mkdir -p /etc/docker/registry/auth RUN mkdir -p /etc/docker/registry
# Copy custom entrypoint script # Create config file with proper YAML formatting
COPY entrypoint.sh /usr/local/bin/ RUN printf "version: 0.1\nstorage:\n filesystem:\n rootdirectory: /var/lib/registry\nhttp:\n addr: :5000\n" > /etc/docker/registry/config.yml
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/etc/docker/registry/config.yml"]

View File

@@ -11,10 +11,6 @@ http:
addr: :5000 addr: :5000
headers: headers:
X-Content-Type-Options: [nosniff] X-Content-Type-Options: [nosniff]
auth:
htpasswd:
realm: basic-realm
path: /etc/docker/registry/auth/htpasswd
health: health:
storagedriver: storagedriver:
enabled: true enabled: true

View File

@@ -9,33 +9,9 @@ services:
- "5000" - "5000"
volumes: volumes:
- registry-data:/var/lib/registry - registry-data:/var/lib/registry
- registry-auth:/etc/docker/registry/auth
- ./config.yml:/etc/docker/registry/config.yml
networks:
- registry-network
registry-ui:
image: joxit/docker-registry-ui:latest
container_name: registry-ui
restart: unless-stopped
expose:
- "80"
environment:
- SINGLE_REGISTRY=${SINGLE_REGISTRY:-true}
- REGISTRY_TITLE=${REGISTRY_TITLE:-Docker Registry}
- DELETE_IMAGES=${DELETE_IMAGES:-true}
- SHOW_CONTENT_DIGEST=${SHOW_CONTENT_DIGEST:-true}
- NGINX_PROXY_PASS_URL=${REGISTRY_URL:-http://registry:5000}
- SHOW_CATALOG_NB_TAGS=${SHOW_CATALOG_NB_TAGS:-true}
- CATALOG_MIN_BRANCHES=${CATALOG_MIN_BRANCHES:-1}
- CATALOG_MAX_BRANCHES=${CATALOG_MAX_BRANCHES:-1}
- TAGLIST_PAGE_SIZE=${TAGLIST_PAGE_SIZE:-100}
- REGISTRY_SECURED=${REGISTRY_SECURED:-true}
- CATALOG_ELEMENTS_LIMIT=${CATALOG_ELEMENTS_LIMIT:-1000}
depends_on:
- registry
networks: networks:
- registry-network - registry-network
command: ["/etc/docker/registry/config.yml"]
networks: networks:
registry-network: registry-network:
@@ -43,6 +19,4 @@ networks:
volumes: volumes:
registry-data: registry-data:
driver: local
registry-auth:
driver: local driver: local

View File

@@ -1,11 +0,0 @@
#!/bin/sh
# Initialize auth file if it doesn't exist
if [ ! -f /etc/docker/registry/auth/htpasswd ]; then
echo "Initializing auth file with default user 'recruas'"
htpasswd -B -c /etc/docker/registry/auth/htpasswd recruas
echo "Auth file created. Default user: recruas"
fi
# Start the registry
exec /bin/registry /etc/docker/registry/config.yml "$@"

9
env.example Normal file
View File

@@ -0,0 +1,9 @@
# Registry Configuration
REGISTRY_STORAGE_PATH=/var/lib/registry
# Expose settings
REGISTRY_PORT=5000
# Optional SSL Configuration
# SSL_CERT_PATH=./certs/domain.crt
# SSL_KEY_PATH=./certs/domain.key

View File

@@ -1,22 +0,0 @@
#!/bin/bash
echo "Setting up Docker Registry with authentication..."
# Build and start the registry
docker-compose up -d --build
echo "Waiting for registry to start..."
sleep 5
# Set initial password for recruas user
echo "Setting password for 'recruas' user..."
docker exec -it registry htpasswd -B /etc/docker/registry/auth/htpasswd recruas
echo "Setup complete!"
echo "Registry is running with authentication enabled."
echo "Default user: recruas"
echo "UI will be available on port 80 (exposed)"
echo "Registry API available on port 5000 (exposed)"
echo ""
echo "To change password later:"
echo "docker exec -it registry htpasswd -B /etc/docker/registry/auth/htpasswd recruas"