- You will need to sign up for a Scarf account. > Note: You can sign up with a valid email address or your GitHub account.
- The container to be tracked must be published to a public registry; eg Docker Hub, GitHub Container Registry.
Note: This guide will use the
Creating a Docker Package
Using Scarf, users can pull your Docker container images via Scarf Gateway using your custom domain.
- Once signed in to Scarf, navigate to the home page.
- Click plus icon in the top navigation, then select
- In the first drop-down click on the package type you would like to create. For this section you will click
Enter the current pull command for your Docker container.
# `hello-world` package docker pull hello-world
Optional: You can add a custom domain or use the domain provided by Scarf Gateway.
- Click the
Submitbutton to be redirected to a success screen with some additional information as to what you can do next.
- Click on on
Go to your packageto view your package details view.
Now you’re all set to start tracking your Docker images with Scarf. Any time your image is downloaded, Scarf will report the following information:
- System and OS statistics of your users
- Company information of your users
- Downloads by versions/tags
In the next section, you will create a tracking pixel that can be added to your project’s documentation or any other web properties associated with your project.
Downloading Docker Packages
In this section you will download your package with the pull command found in your package dashboard to start fetching data.
- Navigate to your package details view.
- Copy the Pull command.
- Navigate to a terminal on your computer and run the Pull command. Note: Make sure the docker daemon is running on your computer.
- Back to the package details view and click on
View Analytics. You should now see the Package Insights starting to populate with data. It may take a few minutes before you see data pulled in. Every time a user pulls your Docker container images from Scarf Gateway the data in your Package Insights will be updated.
Creating a File Package
Once signed in to Scarf, navigate to the home page.
Click plus icon in the navigation, then select New Package.
In the first drop-down click on the package type you would like to create. For this section you will click
Select the package owner from the dropdown.
Give your package a name.
Adding an Outgoing and Incoming URL
This section explains what the Outgoing and Incoming URLs are and how to use a URL template.
1.) Add the URL path where your files are currently located. You can add a simple URL or a URL template like in the example.
This example uses 2 variables
Note: The Outgoing URL is the full URL to your asset on your HTTP/S hosting provider. It can be a URL template but if you use variables in your URL they need to also be used in your Incoming Path that define in the next step.
2.) Choose the domain where your files should be available from. You may choose to use your own domain for serving files. You may also choose to use
<username>.gateway.scarf.sh provided by default by Scarf.
3.) Add the Incoming URL Path where Scarf will direct requests to fetch a file asset.
Note: Any variables used in your Outgoing URL path need to match your Incoming URL.
4.) Click Submit.
Adding Additional Routes
This example will show how to add an additional route. For curl-runnings an additional route that redirects to a specific version will be added, in this case, the most recent package release.
1.) In the top menu click on Tools then in the drop down menu click on Packages.
2.) In the package list dashboard there will be a list of all your packages. These can be filtered by type of packages by selecting the package types you'd like to see. In our example as we just created a file package we're going to want to select File.
3.) Navigate to our newly create file package and in the top right of it's box click the
View Details button.
4.) In the popup modal, use the
File location input to add a new host URL. You can use a template URL here.
5.) Next, add the desired path format for your files. Make sure the variables from your Outgoing and Incoming URLs match if you use a template URL.
6.) Click the
7.) The modal will close and you will see the additional route you just added.
If you have questions or need help, join our Slack community.