---
title: Pulling from a Private Docker Repository with Marathon
description: Suppose you have a private repository on the Docker Hub, then how do you get Marathon to pull from that repository? It's easy if you use Marathon's Artifact Store!
image: http://cdn2.hubspot.net/hubfs/2668666/All-InOne-2016/Image/bg-img.jpg
---

Check out our **[Cloud Native Services](https://www.container-solutions.com/services) **and** **book a call with one of our experts today! 

[![Container Solutions](https://blog.container-solutions.com/hubfs/CS_blog/logo-main.svg "Container Solutions")](http://container-solutions.com)

- share:
- [**](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fblog.container-solutions.com%2Fpulling-from-a-private-docker-repository-with-marathon)
- [**](https://www.twitter.com/share?url=https%3A%2F%2Fblog.container-solutions.com%2Fpulling-from-a-private-docker-repository-with-marathon)
- [**](http://www.linkedin.com/shareArticle?mini=true&url=https://blog.container-solutions.com/pulling-from-a-private-docker-repository-with-marathon)
- [**](https://blog.container-solutions.com/pulling-from-a-private-docker-repository-with-marathon#)

[![](http://cdn2.hubspot.net/hubfs/2668666/All-InOne-2016/Image/bg-img.jpg) ](https://blog.container-solutions.com/pulling-from-a-private-docker-repository-with-marathon)

[Docker](https://blog.container-solutions.com/tag/docker), [Miscellaneous](https://blog.container-solutions.com/tag/miscellaneous), [News](https://blog.container-solutions.com/tag/news)

# Pulling from a Private Docker Repository with Marathon

[Thijs Schnitger](https://blog.container-solutions.com/author/thijs-schnitger)

![Thijs Schnitger](https://blog.container-solutions.com/hubfs/CS--Dev__Assets/asset%205.jpeg)

 May 14, 2015

 2 minutes Read

[![marathon](https://blog.container-solutions.com/hs-fs/hubfs/Imported_Blog_Media/marathon1-1.png?width=97&height=97&name=marathon1-1.png)](https://blog.container-solutions.com/hubfs/Imported_Blog_Media/marathon1-1.png)

Suppose you have a private repository on the [Docker Hub](https://hub.docker.com/), then how do you get [Marathon](https://mesosphere.github.io/marathon/) to pull from that repository? It's easy if you use Marathon's [Artifact Store](https://mesosphere.github.io/marathon/docs/artifact-store.html)!

 Here's how:

Log on to the machine where Marathon is running, and create a place to store the files:

`mkdir /etc/marathon/store`

Specify the path in the Marathon configuration:

`echo "file:///etc/marathon/store" > /etc/marathon/conf/artifact_store`

And restart Marathon:

`/etc/init.d/marathon restart`

Then, log in to the Docker Hub on your local console. You might want to create a special account on the Hub just for pulling images.

`docker login`

Your credentials will be stored in ~/.dockercfg. The next step is to get this file into the Artifact Store. You can either scp it or use curl:

`curl -F "name=file" -F "filename=.dockercfg" -F "file=@.dockercfg" http://marathon-ip:8080/v2/artifacts`

To check if it's really there:

`curl http://marathon-ip:8080/v2/artifacts/.dockercfg`

The last step is to specify the URI in the .json for the application you want to deploy:

`"uris": [ "http://marathon-ip:8080/v2/artifacts/.dockercfg" ]`

Then, if you post your json to Marathon, the Mesos slave will first fetch the .dockercfg and then pull the image from the repository.

[### Configuring resource offers on Mesos

](https://blog.container-solutions.com/configuring-resource-offers-on-mesos)

[![prev-arrow](https://cdn2.hubspot.net/hubfs/3842749/Wow%202019/Images/left-arrow.png) Previous article](https://blog.container-solutions.com/configuring-resource-offers-on-mesos)

[ Next article ![next-arrow](https://cdn2.hubspot.net/hubfs/3842749/Wow%202019/Images/right-arrow.png) ](https://blog.container-solutions.com/what-the-fk-is-a-microservice-a-reading-list-for-the-perplexed)

[

### What the F**k is a Microservice? A Reading List for the Perp...

](https://blog.container-solutions.com/what-the-fk-is-a-microservice-a-reading-list-for-the-perplexed)

Comments

Leave your Comment

![cs-logo-white](https://blog.container-solutions.com/hs-fs/hubfs/cs-logo-white.png?width=150&height=61&name=cs-logo-white.png "cs-logo-white")

#### **Talk to sales**

[info@container-solutions.com](mailto:info@container-Solutions.com)

#### Stay In Touch

- [**](https://www.linkedin.com/company/container-solutions/)
- [**](https://twitter.com/containersoluti)

© 2024 Container Solutions