|
| 1 | +--- |
| 2 | +title: JFrog Artifactory |
| 3 | +description: Learn how to use Artifactory to host container images in Coder. |
| 4 | +--- |
| 5 | + |
| 6 | +This article will walk you through setting up |
| 7 | +[Artifactory](https://jfrog.com/artifactory/) as a Docker registry in Coder. |
| 8 | + |
| 9 | +JFrog Artifactory serves as a central hub for housing and managing any kind of |
| 10 | +artifact you might be interested in securely managing across your entire |
| 11 | +organization, including container images. It can be self-hosted which may be |
| 12 | +particularly useful for hardened environments where external network access is |
| 13 | +undesirable. |
| 14 | + |
| 15 | +We have based these instructions off Artifactory's documentation. Please see the |
| 16 | +following links for more information: |
| 17 | + |
| 18 | +- [Docker Registry](https://www.jfrog.com/confluence/display/JFROG/Docker+Registry) |
| 19 | +- [Getting Started with Artifactory as a Docker Registry](https://www.jfrog.com/confluence/display/JFROG/Getting+Started+with+Artifactory+as+a+Docker+Registry) |
| 20 | + |
| 21 | +## Step 1: Create an Artifactory repository |
| 22 | + |
| 23 | +1. If you do not already have an account you can [start up a free |
| 24 | + trial](https://jfrog.com/artifactory/) or get yourself a free instance to |
| 25 | + play with. |
| 26 | +1. Log in to your Artifactory dashboard. |
| 27 | +1. Navigate to **Repositories** in the sidebar. |
| 28 | +1. Click **+ Add Repositories**. |
| 29 | +1. Select **Docker**. |
| 30 | +1. Name your repository. |
| 31 | +1. Click **Create Local Repository**. |
| 32 | + |
| 33 | +## Step 2: Add images |
| 34 | + |
| 35 | +You can push and pull images as you would with any other Docker registry once |
| 36 | +you log in. |
| 37 | + |
| 38 | +```console |
| 39 | +docker login $ARTIFACTORY_URL |
| 40 | +``` |
| 41 | + |
| 42 | +If you have trouble logging in click your user account icon in the upper right |
| 43 | +corner of the Artifactory dashboard, go to **Set Me Up**, then select **docker** |
| 44 | +to find exactly what username and password you can provide to get logged in. |
| 45 | + |
| 46 | +At this stage you can add any images you want to use with Coder. For example |
| 47 | +with an image called `hello-world` and a repository called `images`: |
| 48 | + |
| 49 | +```console |
| 50 | +docker push $ARTIFACTORY_URL/images/hello-world |
| 51 | +``` |
| 52 | + |
| 53 | +## Step 3: Configure Coder |
| 54 | + |
| 55 | +To add the registry to Coder you can use the same credentials you used for |
| 56 | +`docker login` but in production you may want to create a new user with |
| 57 | +read-only permissions. This can be done by clicking the cog icon in the upper |
| 58 | +right corner of your Artifactory dashboard then clicking **User Management**. |
| 59 | + |
| 60 | +Once you have the credentials you want to use grab your Artifactory URL and and |
| 61 | +the full path to an image then [add a new registry](../../admin/registries/index.md) |
| 62 | +to Coder. |
| 63 | + |
| 64 | +For example here we add an image stored at `codercom/enterprise-intellij` in an |
| 65 | +Artifactory server called `test` and a repository called `images`: |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +## Other Notes |
| 70 | + |
| 71 | +We have an open-source version of Microsoft's extension marketplace for VS Code |
| 72 | +which is capable of using Artifactory for extension storage. If you use VS Code |
| 73 | +or code-server with Coder and are interested in further securing your supply |
| 74 | +chain with Artifactory check it out |
| 75 | +[here](https://github.com/coder/code-marketplace/). |
0 commit comments