How to Use SharkCluster Container Registry to Store and Deploy Your Docker Images
Back to the blog
How-To / Container Registry

How to Use SharkCluster Container Registry to Store and Deploy Your Docker Images

SharkClusterSharkCluster TeamNovember 12, 20265 min read

Once you package your applications as Docker images, you need somewhere to keep them. Public registries are fine for open-source images, but your own code belongs in a private registry that only you, your team and your servers can pull from.

SharkCluster Container Registry gives you that registry inside the same dashboard you use for your servers. This guide walks through creating a registry, pushing your first image, pulling it onto a server, and keeping storage under control.

What you get

  • Private or public registries. Private registries can only be pulled by you and invited members. Public ones can be pulled by anyone without a token.
  • Personal and organization registries. Use your personal registry for your own projects, or an organization registry to share images with your team.
  • Access tokens and robot accounts for logging in from your machine, your servers and your CI pipeline.
  • Automatic tag cleanup so old builds don't fill up your storage.
  • Storage and activity views to see how much space you use and who pushed what.

Everything lives under Container Registry in the main sidebar, with sections for Registries, Access Tokens, Organizations, Robot Accounts, Storage, Activity and Settings.

How to Use SharkCluster Container Registry to Store and Deploy Your Docker Images

Step 1: Create a registry

  1. Go to Container Registry → Registries and click create.
  2. Choose a subscription plan. Plans differ mainly in how much storage you get.
  3. Enter a unique name. It can contain only lowercase letters, numbers and dashes, for example acme-apps.
  4. Choose the visibility: Private or Public. This becomes the default for new repositories, and you can change it per repository later.
  5. Optionally add a description, then create the registry.

Your images will live under this address:

bash
registry.sharkcluster.com/acme-apps

Step 2: Create an access token

Docker logs in with a username and password. In SharkCluster, the password is a Personal Access Token, so your account password never ends up in scripts or CI settings.

  1. Go to Container Registry → Access Tokens and click Create Token.
  2. Give it a name that says where it will be used, such as laptop or prod-server-1.
  3. Pick an expiry date, or choose Never expire for long-running servers.
  4. Copy the token and keep it somewhere safe. It is shown only once.

Step 3: Log in from Docker

bash
docker login registry.sharkcluster.com

When asked, enter the email address you registered with as the username, and paste the token as the password. On a CI runner you can do the same thing without a prompt:

bash
echo "$SHARK_REGISTRY_TOKEN" | docker login registry.sharkcluster.com \
  --username [email protected] --password-stdin

Step 4: Push your first image

Tag a local image with your registry address, then push it. The repository is created automatically on the first push.

bash
docker build -t my-api .
docker tag my-api registry.sharkcluster.com/acme-apps/my-api:1.0.0
docker push registry.sharkcluster.com/acme-apps/my-api:1.0.0

Use meaningful tags such as version numbers (1.0.0) or Git commit hashes, not only latest. That way you always know exactly what is running, and rolling back is just a matter of pulling the previous tag.

Step 5: Pull and run the image on a server

On any server, including your SharkCluster servers, log in once with a token made for that server, then pull and run the image:

bash
docker login registry.sharkcluster.com
docker pull registry.sharkcluster.com/acme-apps/my-api:1.0.0
docker run -d --name my-api -p 8080:8080 \
  registry.sharkcluster.com/acme-apps/my-api:1.0.0

With Docker Compose, point the service at the registry image:

yaml
services:
  api:
    image: registry.sharkcluster.com/acme-apps/my-api:1.0.0
    restart: unless-stopped
    ports:
      - "8080:8080"

To deploy a new version, push a new tag, update the tag on the server and run docker compose pull && docker compose up -d.

Working with a team: organizations and robot accounts

Organizations let several people share one registry. Invite your teammates, and everyone can push and pull according to their permissions, without sharing a personal token.

Robot accounts are credentials for machines, not people. Create one inside an organization registry for each CI pipeline or deployment server. If a robot account leaks, delete it and create a new one: no person's access is affected. Robot accounts belong to organization registries; for automation against your personal registry, use a Personal Access Token.

Keep storage tidy with Auto Delete Tags

Every CI build that pushes a new tag adds to your storage, and after a few months most of those tags will never be used again. Auto Delete Tags cleans them up for you.

  1. Open your registry and go to its Settings tab.
  2. Turn on Auto Delete Tags.
  3. Set Keep the latest to the number of tags to keep per repository. The default is 10, and you can choose anything from 1 to 1000.

A cleanup pass runs once a day. In each repository, tags are sorted by when they were last pushed, newest first, and everything beyond your keep count is deleted. The tags you see at the top of a repository's Tags list are exactly the ones that are kept.

Choose a number that covers your rollback needs. If you deploy several times a day and might need to roll back a week, 10 may be too few. Check the Storage section to see how much space each registry uses.

Security tips

  • Keep registries private unless you really mean to publish the images.
  • Create one token per machine, so you can revoke one without breaking the others.
  • Give tokens an expiry date where you can, and replace them before they expire.
  • Never bake secrets such as API keys or database passwords into images. Pass them in as environment variables at runtime.
  • Check the Activity section from time to time to see who pushed and deleted what.

Wrapping up

A private registry gives every deployment a single, versioned source of truth. Create a registry, push an image, pull it onto a server, and turn on Auto Delete Tags so storage stays under control. If your containers need a database, see how to create a managed database in SharkCluster.

Share this article
Share

Run this on your own VPS

Deploy servers and applications on infrastructure you own, managed from one panel — backups, caching, firewall and monitoring included.

Start your journey today

How do you start
with SharkCluster?

To start with SharkCluster, create an account and your first server on DigitalOcean, Contabo or OVHcloud — no credit card or lock-in contract is needed. Every account includes free self-hosted business apps, free local backups, unlimited migrations and a dedicated DevOps manager.

No lock-in contracts
No credit card required
Dedicated DevOps manager