Dheeraj kumar

In this blog, we will learn about how to setup a docker private registry and setup authentication as well through docker.

Run this Dockerfile to create your registry image and run it.

FROM registry:2
RUN mkdir -m 777 data auth
ENV REGISTRY_AUTH_HTPASSWD_PATH /auth/registry.password
RUN apk update && apk add apache2-utils
RUN cd auth && htpasswd -b -B -c registry.password admin admin
RUN htpasswd -b registry.password dev dev@dev

Command to build & run the registry image:

docker build -t local_registry .
docker run -p 5000:5000 -d -v /data:/data local_registry

Api’s to query the Docker images stored in the registry.

List all repositories (effectively images):

curl -X GET -u admin:admin https://myregistry:5000/v2/_catalog
> {"repositories":["redis","ubuntu"]}

List all tags for a repository:

curl -X GET admin:admin https://myregistry:5000/v2/ubuntu/tags/list
> {"name":"ubuntu","tags":["14.04"]}



Expand the volume within the OS using diskpart utility

When you have expanded the disk for the VM, you need to go into the OS and expand the volume to encompass the new space. There are several methods for expanding a partition. This section covers connecting the VM using an RDP connection to expand the partition using DiskPart.

  1. Open an RDP connection to your VM.
  2. Open a command prompt and type diskpart.
  3. At the DISKPART prompt, type list volume. Make note of the volume you want to extend.
  4. At the DISKPART prompt, type select volume <volumenumber>. This selects the volume volumenumber that you want to extend into contiguous, empty space on the same disk. Ex: select volume 1
  5. At the DISKPART prompt, type extend [size=<size>]. This extends the selected volume by size in megabytes (MB).Ex: extend size=125000