How to Configure Docker to Work with Artifactory on a Non-Standard SSL Port

How to Configure Docker to Work with Artifactory on a Non-Standard SSL Port

AuthorFullName__c
David Shin
articleNumber
000004987
ft:sourceType
Salesforce
FirstPublishedDate
2022-09-07T06:40:05Z
lastModifiedDate
2023-01-22T11:06:36Z
VersionNumber
2

To configure Docker to push images to Artifactory using SSL on a port other than port 443, do the following:

1. Edit your .dockercfg file (typically located in your docker-user's home directory) so the URL will include the SSL      listening port. For example:
 

 {

   "https://docker.example.com:5000" : 

    {

      "auth" : "YWRtaW46QVAyZFVadUM0WEh4Z1Q2cld1aHExdlNBMkRk",

      "email" : "abcd@yourdomain.com"

    }

  }

 

2. Edit your nginx.conf file to listen to the SSL port and add that port to the proxy_set_header Host $host line.

 For example:

  listen 5000 ssl;

  proxy_set_header Host $host:5000;


Reload Nginx after making the changes above (sudo nginx -s reload).


3. Tag the Docker image that you want to push, such that it will include the SSL port. For example:

  docker tag ubuntu docker.example.com:5000/ubuntu


4. Run docker push to push the image. For example:

  docker push docker.example.com:5000/ubuntu

 

Keywords: Docker, non-standard SSL port