Setting up ProGet as a Private Docker Repository

Setting up ProGet as a Private Docker Repository

When creating your own Docker images it's useful to have a local private repo to keep those not so stable versions on. The usual go-to for this would be the Sonatype Nexus3 OSS version which is a great bit of software if somewhat GUI unfriendly and upsell driven these days.

My preferred alternative is Inedo ProGet which I started using a long time ago to host Chocolatey files when it was a Windows only application. times, however, have changed and there is a Linux Docker container (5.3.30 at time of writing) available which will get Proget up and running quickly.

Head over to the ProGet homepage

ProGet | Package your Applications and Components – Inedo

Clicking on the download line will bring up the Windows Download of the Linux Docker Download

This post will go through the docker install some things you might miss, then some basic setup once ProGet is up and running.

Assumptions and things

  • You'll need docker on you're chosen distro up and running, out of scope for this tutorial.
  • If you're anti-Microsoft, stop here, this system has its roots in the Microsoft world so uses some software within the container that might blow your poor little brain.
  • I don't work for, make any money from, have any affiliation with Inedo, I'm not getting anything for writing this, I am writing it because I found it handy and Nexus3 was really annoying me.

Install

The first step is to create a network for ProGet and the database to communicate on.

Network

docker network create proget

Database

The first step is to set up an SQL Database, for this example, we will host it within a container, however as long as the ProGet docker container can access it, you can host this DB anywhere.

docker run --name proget-sql \
  -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=‹YourStrong!Passw0rd›' \
  -e 'MSSQL_PID=Express' --net=proget --restart=unless-stopped \
  -d mcr.microsoft.com/mssql/server:2019-latest

There are some things of note here

  1. ProGet's instructions are using MSSQL server 2019, I've not tested this on MariaDB or MySQL so don't know if it works.
  2. You'd need to change the line
'MSSQL_SA_PASSWORD=‹YourStrong!Passw0rd›

to something better for the password.

A database needs to be created on the Db server (proget-sql) which can be done using the following command:

docker exec -it proget-sql /opt/mssql-tools/bin/sqlcmd \
-S localhost -U SA -P '‹YourStrong!Passw0rd›' \
-Q 'CREATE DATABASE [ProGet] COLLATE SQL_Latin1_General_CP1_CI_AS'

Whatever the password was changed to needs to be changed here in the section

-P '‹YourStrong!Passw0rd›'

ProGet Server

the docker run command will download the latest image (read more on that in a bit) and connect the server to the MSSQL Db which was previously installed.

docker run -d -v proget-packages:/var/proget/packages -p 80:80 --net=proget \
--name=proget --restart=unless-stopped \
-e SQL_CONNECTION_STRING='Data Source=proget-sql; Initial Catalog=ProGet; User ID=sa; Password=‹YourStrong!Passw0rd›' \
proget.inedo.com/productimages/inedo/proget:<version>

Remember

If you changed the SQL admin password above (you did do that, didn't you?) the above command will need to be edited to reflect the change of password.

Password=‹YourStrong!Passw0rd›'

The last part of the docker run command also shows that Inedo is not hosting its images on Docker Hub .

proget.inedo.com/productimages/inedo/proget:<version>

The Docker Run command will also need to know what version to install with thee last tag or will fail, the latest versions can be found here:

https://proget.inedo.com/containers/repositories/overview?feedId=22&repositoryName=inedo%2Fproget

At the time of writing the latest stable version is 5.3.30

so the complete Docker run command will be

docker run -d -v proget-packages:/var/proget/packages -p 80:80 --net=proget     --name=proget --restart=unless-stopped     -e SQL_CONNECTION_STRING='Data Source=proget-sql; Initial Catalog=ProGet; User ID=sa; Password=‹YourStrong!Passw0rd›'     proget.inedo.com/productimages/inedo/proget:5.3.30

Once complete you can use

docker logs proget -f

To watch the startup logs on your Linux console and when started should be able to access on port 80

http://<proget server ip address>

Activate

When you open the above URL you'll (hopefully) be greeted with a screen similar to this

Based on the lack of a Licence key click on Request a licence key

Enter the required details and click on Request a Licence Key

Click on Activate Licence

All done, click on Close

You'll now be greeted with a changed Home screen.

This feed will take you through some of the basics of setting up ProGet

Setup a Feed

From the Home screen

Click on Create New Feed

ProGet can host numerous different package types and is not limited to Docker,

However for now click on Container Images

Give the Feed a Name and a Description, and in this case, make sure Private/Internal packages is selected

Click on Create New Feed

The Container feed will be created and you'll be taken to the feed page

Click on Push Image

The Docker push command for the server will be displayed.

The first feed has been created.

Admin User Password

So far this has been pretty open, with no need to login, the server can (and probably should ) be locked down quite a bit, it can be connected to an LDAP back end or use local users. Before this can be down the Admin password needs to be changed.

In the top right click on the person icon.

Click on Login

The screen is pretty blunt

Click on login as Admin/Admin

Go back up to the top right, click on the person icon again

this 

This time click on Change Password

Complete the Change password screen

Click on change password and you're a little more secure.

Go back to the home screen and some more tasks will appear

Running through these will build up your understanding of how ProGet works.

Docker Command Line

If you try and do (using my Dev example IP)

docker login -u admin 192.168.86.43

It will fail, as its looking for an HTTPS repo, and you can do that with ProGet, however for testing and to use the HTTP protocol you'll need to do the following

sudo nano /etc/docker/daemon.json

This file might not exist, it's ok to create it.

Add the following

{
  "insecure-registries" : ["192.168.86.43"]
}

Using the IP or IP:PORT combination for your server

The Docker service will need to be restarted, and both the SQL and the Proget instance have been installed to restart automatically.

Using the following command

docker login -u admin 192.168.86.43

Using the ProGet password set for admin earlier will result in

WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

And you're done.

Thoughts

ProGet has come a long way since the early days as a windows only platform, and while it may lack the spit and polish of some solutions it's worth a look if only for the quick and easy setup.

there's a lot more to the setting up of a server and as we can see from Inedo's site they use it for hosting their own images.

Further reading

Linux and Docker Installation Guide | Installation & Maintenance | Pro
ProGet for Linux is available using our official Docker image. This set-up guide will also help you prepare to use Docker with ProGet, even on Windows.

Share Tweet Send
0 Comments
Loading...
You've successfully subscribed to Tech Blog Posts - David Field
Great! Next, complete checkout for full access to Tech Blog Posts - David Field
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.