Skip to content

j2eeexpert2015/testcontainers-with-spring-boot-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👤 About the Instructor

Ayan Dutta - Instructor

Hi, I’m Ayan Dutta, a Software Architect, Instructor, and Content Creator.
I create practical, hands-on courses on Java, Spring Boot, Debugging, Git, Python, and more.


🌐 Connect With Me


📺 Subscribe on YouTube

YouTube


📚 Explore My Udemy Courses

🧩 Java Debugging Courses with Eclipse, IntelliJ IDEA, and VS Code


Eclipse Debugging Techniques

Java Debugging With IntelliJ

Java Debugging with VS Code

💡 Java Productivity & Patterns


IntelliJ IDEA Tips & Tricks

Creational Design Patterns

🐍 Python Debugging Courses


Python Debugging With PyCharm

Python Debugging with VS Code

Python Debugging (Free)

🛠 Git & GitHub Courses


GitHub Desktop Guide

Git & GitHub with Eclipse

🐳 Preparing a Custom PostgreSQL Image on GHCR

These steps show how to prepare and test a custom PostgreSQL image in GitHub Container Registry (GHCR) to be used in Testcontainers.

🔐 Step 1: Generate a GitHub Personal Access Token (GHCR_PAT)

  1. Go to: https://github.com/settings/tokens?type=beta
  2. Click: Generate new token → Classic
  3. Select scopes:
    • ✅ read:packages
    • ✅ write:packages
  4. Copy the generated token and save it securely

You’ll use this token as the password when logging in to GHCR.


🔧 Step 2: Tag and Push to GHCR

Using your own GitHub username:

# Pull the official Postgres image
docker pull postgres:15

# Tag the image
docker tag postgres:15 ghcr.io/<your-github-username>/approved-images/postgres:15
# Example:
docker tag postgres:15 ghcr.io/j2eeexpert2015/approved-images/postgres:15

# Login to GHCR
echo <GHCR_PAT> | docker login ghcr.io -u <your-github-username> --password-stdin
# Example:
echo <GHCR_PAT> | docker login ghcr.io -u j2eeexpert2015 --password-stdin

# Push to GHCR
docker push ghcr.io/<your-github-username>/approved-images/postgres:15
# Example:
docker push ghcr.io/j2eeexpert2015/approved-images/postgres:15

🚫 Step 3: Test Access Without Authentication

To simulate an unauthenticated environment:

# Logout from GHCR
docker logout ghcr.io

# Remove local image
docker rmi ghcr.io/<your-github-username>/approved-images/postgres:15
# Example:
docker rmi ghcr.io/j2eeexpert2015/approved-images/postgres:15

# Attempt pull without auth
docker pull ghcr.io/<your-github-username>/approved-images/postgres:15
# Example:
docker pull ghcr.io/j2eeexpert2015/approved-images/postgres:15

✅ This pull should fail if the image is private, confirming access is restricted without credentials.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages